Hello I'm trying to use as_json to output the parent object as an include. Here is my code :
photo.as_json(:include => [:comments, :likes])
This code works, this one doesn't :
photo.as_json(:include => [:comments, :likes, :user])
I get the error :
NoMethodError: undefined method `macro' for nil:NilClass
Any one ? Thanks :)