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

I’ve created a gist with the specific problem I’m seeing

Any ideas why the eager loading works for grabbing the collection from
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?


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