Find all items which have these tags

Hi

This works: Item.find(:all, :include => 'tags', :conditions => ["tags.name = ?","Rainproof"])

This works as well: Item.find(:all, :include => 'tags', :conditions => "tags.name in ('Rainproof','Bowl')") (Here without substitution.)

How to find the items which have a tag with name "Rainproof" AND a tag with name "Bowl"?

Tobi

Tobi Reif wrote:

Hi

This works: Item.find(:all, :include => 'tags', :conditions => ["tags.name = ?","Rainproof"])

This works as well: Item.find(:all, :include => 'tags', :conditions => "tags.name in ('Rainproof','Bowl')") (Here without substitution.)

How to find the items which have a tag with name "Rainproof" AND a tag with name "Bowl"?

Not sure if this will work, as I'm not very good at SQL anymore...

Item.find(:all, :include => :tags, :conditions => [ 'tags.name = ? AND tags.name = ? ], 'Rainproof', 'Bowl' ])