I have a class TwitterUser that has many TwitterLists
class TwitterUser < ActiveRecord::Base
has_many :twitter_lists, :dependent => :destroy
end
When I do:
user = TwitterUser.includes(:twitter_lists).find(12615489)
then:
lists = user.twitter_lists
it eagerly loads the twitter lists for that user in the first "find", so it doesn't run a query when I do user.twitter_lists (this is expected).
However when I try to convert the user to JSON like: user.to_json
I don't see the nested association "twitter_lists" anywhere in the JSON. Even though I used eager loading. Why is this? And how can I make it appear in the JSON?