Tobi_R
1
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
–
http://www.rubynaut.com/
Tobi_R
2
Tobi R. 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’ ])