Reputation: 17803
I am using Rails 2.3.5 and is wondering if it is possible to rewrite this query using conditions as a hash.
joined_deals = Deal.all :joins => :shops
:conditions => ["shops.name = ?", name]
to something like :conditions => {"shops.name" => name}
. Is it possible in Rails 2?
Upvotes: 0
Views: 224
Reputation: 7035
Yes, it is possible in Rails 2.
For more information, refer here: specifying-conditions-on-the-joined-tables
Upvotes: 1