Tyler Benziger
2014-Apr-02 22:11 UTC
Trying to understand eager loading and accessing collections from within instance methods
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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/77cb25cd-00b2-46b4-8657-ceec1d10b350%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.