diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2011-01-14 22:51:15 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2011-01-14 22:51:15 +0530 |
commit | 93c208a630e5cd96071ed5581fcd1c23708b3817 (patch) | |
tree | 5ebe7daba29ba0559322028156f5d6c47a04adf9 /railties/guides/source/active_record_basics.textile | |
parent | 31767b003227148ce06b7c8df0f533b7cdeddd9b (diff) | |
download | rails-93c208a630e5cd96071ed5581fcd1c23708b3817.tar.gz rails-93c208a630e5cd96071ed5581fcd1c23708b3817.tar.bz2 rails-93c208a630e5cd96071ed5581fcd1c23708b3817.zip |
use new AR api
Diffstat (limited to 'railties/guides/source/active_record_basics.textile')
-rw-r--r-- | railties/guides/source/active_record_basics.textile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/guides/source/active_record_basics.textile b/railties/guides/source/active_record_basics.textile index f0081b48c0..b7926f3a3b 100644 --- a/railties/guides/source/active_record_basics.textile +++ b/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. |