2010-08-11 16 views
0
Product.find(:all, 
    :conditions => { :companies => { :malls => { :id => 1},:products => {:title => "nexus one"} }}, 
    :joins => [:company => :mall]) 

回答

1

我找到了解決辦法,我想我不得不採取休息,

Product.find(:all,:conditions => ['title LIKE ? and mall_id = ?', "%#{search}%",mall_id], 
     :joins => [:company => :mall]) 
相關問題