Comments on: ActiveRecord finder: Now we can use hash as conditions /2007/02/22/activerecord-finder-now-we-can-use-hash-as-conditions/ Its all about Ruby On Rails Thu, 14 Mar 2013 06:19:42 +0000 hourly 1 #/?v= By: Akhil Bansal /2007/02/22/activerecord-finder-now-we-can-use-hash-as-conditions/comment-page-1/#comment-299 Akhil Bansal Thu, 03 May 2007 13:02:47 +0000 /2007/02/22/activerecord-finder-now-we-can-use-hash-as-conditions/#comment-299 I don't have exact idea when it was introduced, but it was near rails 1.2.0 I don’t have exact idea when it was introduced, but it was near rails 1.2.0

]]>
By: JFSIII /2007/02/22/activerecord-finder-now-we-can-use-hash-as-conditions/comment-page-1/#comment-298 JFSIII Thu, 03 May 2007 11:55:47 +0000 /2007/02/22/activerecord-finder-now-we-can-use-hash-as-conditions/#comment-298 This is great. I've long thought the current way was cumbersome and not keeping with The Rails Way. I mean, nearly everything else is Model.method(:param => :value) except find(). When I say not keeping with The Rails Way, I mean that it's putting the user right into the muck. You don't write SQL anywhere else in the app (excluding find_by_sql()), so how can we expect a user to know how to properly format a WHERE clause? Again, great news. In which version of Rails will this appear? This is great. I’ve long thought the current way was cumbersome and not keeping with The Rails Way.

I mean, nearly everything else is Model.method(:param => :value) except find().

When I say not keeping with The Rails Way, I mean that it’s putting the user right into the muck. You don’t write SQL anywhere else in the app (excluding find_by_sql()), so how can we expect a user to know how to properly format a WHERE clause?

Again, great news. In which version of Rails will this appear?

]]>
By: Akhil Bansal /2007/02/22/activerecord-finder-now-we-can-use-hash-as-conditions/comment-page-1/#comment-297 Akhil Bansal Wed, 28 Feb 2007 04:49:00 +0000 /2007/02/22/activerecord-finder-now-we-can-use-hash-as-conditions/#comment-297 Hi zerohalo, Try this for OR condition as: :conditions=>["firstname =>:fname OR lastname => :lname", {:fname=> @fname, :lname => @lname}] Hi zerohalo,
Try this for OR condition as:

:conditions=>["firstname =>:fname OR lastname => :lname", {:fname=> @fname, :lname => @lname}]

]]>
By: Akhil Bansal /2007/02/22/activerecord-finder-now-we-can-use-hash-as-conditions/comment-page-1/#comment-296 Akhil Bansal Sat, 24 Feb 2007 06:22:01 +0000 /2007/02/22/activerecord-finder-now-we-can-use-hash-as-conditions/#comment-296 Zerohalo, Currently we have no way to specify 'OR' Zerohalo,
Currently we have no way to specify ‘OR’

]]>
By: zerohalo /2007/02/22/activerecord-finder-now-we-can-use-hash-as-conditions/comment-page-1/#comment-295 zerohalo Fri, 23 Feb 2007 19:17:12 +0000 /2007/02/22/activerecord-finder-now-we-can-use-hash-as-conditions/#comment-295 Nice. How do you specify the OR condition? Nice. How do you specify the OR condition?

]]>
By: Paul Davis /2007/02/22/activerecord-finder-now-we-can-use-hash-as-conditions/comment-page-1/#comment-294 Paul Davis Wed, 21 Feb 2007 21:55:05 +0000 /2007/02/22/activerecord-finder-now-we-can-use-hash-as-conditions/#comment-294 In what version of AR does this functionality appear? In what version of AR does this functionality appear?

]]>