When you attempt to ":include" multiple associated records in a call to to_json, only the first association is included if you specify further inclusions for that association.
For example:
render :json => video.to_json(
:include => {:fight_sets => {
:include => [:fight_matches => {:include => [:player_one_team, :player_two_team]}, :player_one => {}, :player_two => {}]}});
the json will include all of the fight_matches, but will not include either player_one or player_two.
If instead, you swap :fight_matches
with :player_one
, giving you
render :json => video.to_json(
:include => {:fight_sets => {
:include => [:player_one => {}, :fight_matches => {:include => [:player_one_team, :player_two_team]}, :player_two => {}]}});
the json will include player_one but not fight_matches or player_two.