Product.find(:all,
:conditions => { :companies => { :malls => { :id => 1},:products => {:title => "nexus one"} }},
:joins => [:company => :mall])
答案 0 :(得分:1)
我找到了解决方案,我想我必须休息一下,
Product.find(:all,:conditions => ['title LIKE ? and mall_id = ?', "%#{search}%",mall_id],
:joins => [:company => :mall])