Skip to content

Commit

Permalink
Updating find examples to Rails 3 syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschright committed Aug 19, 2011
1 parent b5d6146 commit 4b224e3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions rubything.textile
Original file line number Diff line number Diff line change
Expand Up @@ -634,14 +634,12 @@ h1. Where's My Stuff

Rails models have built-in finder methods that help you retrieve records from the database.

% TODO upgrade to rails3 syntax

Try:
* @Rant.all@
* @Rant.order("created_at DESC")@
* @Rant.first@
* @Rant.find(:all, :user_id => 1)@
* @Rant.all(:user_id => 1)@
* @Rant.find_by_user_id(1)@
* @Rant.where("user_id = 1")@
* @Rant.where(:user_id => 1)@

h1. At the Console

Expand Down

0 comments on commit 4b224e3

Please sign in to comment.