Permalink
Browse files

use new AR api

  • Loading branch information...
1 parent 31767b0 commit 93c208a630e5cd96071ed5581fcd1c23708b3817 @vijaydev vijaydev committed Jan 14, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/guides/source/active_record_basics.textile
@@ -180,7 +180,7 @@ Active Record provides a rich API for accessing data within a database. Below ar
<ruby>
# find all users named David who are Code Artists and sort by created_at in reverse chronological order
- users = User.all(:conditions => { :name => 'David', :occupation => 'Code Artist'}, :order => 'created_at DESC')
+ users = User.where(:name => 'David', :occupation => 'Code Artist').order('created_at DESC')
</ruby>
You can learn more about querying an Active Record model in the "Active Record Query Interface":"active_record_querying.html" guide.

0 comments on commit 93c208a

Please sign in to comment.