Trying to understand eager loading and accessing collections from within instance methods

9 views
Skip to first unread message

Tyler Benziger

unread,
Apr 2, 2014, 6:11:42 PM4/2/14
to rubyonra...@googlegroups.com, ty...@benziger.net
I'm trying to optimize some of my queries by taking advantage of eager loading.

I've created a gist with the specific problem I'm seeing here: https://gist.github.com/tybenz/9944205

Any ideas why the eager loading works for grabbing the collection from the rails console but a SQL query is required when I try to access the collection from inside the instance method?

Is there anything I can do to fix this?

Thanks,
Tyler
Reply all
Reply to author
Forward
0 new messages