ruby - Rails as_json not including all associations -


for arguments sake, lets have legs object. i'm trying call as_json on , include associations - set correctly works in console.

this have:

@legs.as_json(   :include => {     :shoes => {       :include => {         :left_shoe => {           :include => {             :shoe_lace => {:include => :sock}           }         }       },       :right_shoe => {         :include => {           :shoe_lace => {:include => :sock}         }       }     }   } ) 

for reason it's not including right_shoe. stops @ left_shoe. ideas?

i think per comments right shoe @ wrong level. try this:

@legs.as_json(   :include => {     :shoes => {       :include => {         :left_shoe => {           :include => {             :shoe_lace => {:include => :sock}           }         },         :right_shoe => {           :include => {             :shoe_lace => {:include => :sock}           }         }       }     }   } ) 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -