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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs