views:

44

answers:

1
Product.find(:all,
    :conditions => { :companies => { :malls => { :id => 1},:products => {:title => "nexus one"} }},
    :joins => [:company => :mall])
+1  A: 

I found the solution, I think I have to take break,

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