ruby on rails - Merge associated items from an activerecord relation result -


how combine example tag.has_many :images, through: :taggings bunch of tags?

something around unless theres simpler:

images = ??? tag.where("name in (?)", tag_params).each |tag|   images = images.merge(tag.images) end 

how about:

images = image.joins(:tags).where(['tags.id in (?)', tag_params]) 

?


Comments

Popular posts from this blog

c++ - list<myClass<int> * > sort -

SoapUI on windows 10 - high DPI/4K scaling issue -

java - why am i getting a "cannot resolve method" error on getApplication? -