If I have the following tables:
newsletters - with id(int), title(string), content(string),
tags - id(int), name(string), kind(int)
newsletters_tags - newsletter_id(ind), tag_id(int)
And also the models Newsletter and Tag, each in a HABTM relationship
with each other.
Ok, so I want to find all newsletters that share a collection of tags,
using the tag ids.
I tried to make the following query but it didn’t work:
Newsletter.find(:all, :conditions => [“tag_id IN(?)”, “12, 16”])
I would like to know whats going wrong and how could I do it.
Can you help me?