From 93c208a630e5cd96071ed5581fcd1c23708b3817 Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Fri, 14 Jan 2011 22:51:15 +0530 Subject: use new AR api --- railties/guides/source/active_record_basics.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides') 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 # 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') You can learn more about querying an Active Record model in the "Active Record Query Interface":"active_record_querying.html" guide. -- cgit v1.2.3