June 08, 2006
Older: Want railstips.org?
Newer: Acts As Versioned With Associations
Updates To Active Record Find
According to changeset 4425 find just got a bit of an update. You can now pass in a hash to the condition parameter and it will be converted to an AND-based condition string.
The following …
Person.find(:all, :conditions => [ "last_name = ? and status = ?", "Catlin", 1 ], :limit => 2)
is now the same as …
Person.find(:all, :conditions => { :last_name => "Catlin", :status => 1 }, :limit => 2)
0 Comments
Thoughts? Do Tell...