Try m = Movie.map(&:genders).includes(:genres)
On Thursday, July 2, 2015 at 4:50:55 AM UTC-4, Alexandru Calinoiu wrote: > > Hi > > > I have a basic active query like so: > > > m = Movie.includes(:genres) > > > `m.genders` is an `CollectionProxy` in this case. Is there a way I can > get this as an array? > > I know that calling to_a will do this, but this becomes impractical for a > bunch of includes. > > > The problem that I am having is that when I cache m in redis after > fetching it the genres query is done again if I don't iterate the > collection. > > > Regards, > > -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/feefa47f-0bb3-4283-a7bf-2ec33f73ad75%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

