Permalink
Browse files

Adding `first_or_new` documentation to the AR Querying guide.

  • Loading branch information...
1 parent 84dad44 commit ee822f257e2f3f3b571772f30ae3a8edd69538c3 @nhocki nhocki committed with andmej Aug 30, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/guides/source/active_record_querying.textile
View
2 railties/guides/source/active_record_querying.textile
@@ -1069,7 +1069,7 @@ NOTE: Be sure to check the extensive *Active Record Validations and Callbacks Gu
h4. +first_or_new+
-The +first_or_new+ method will work just like +first_or_create+ but it will not call +create+ but the +new+. This means that a new model instance will be created in memory but won't be saved to the database. Continuing with the +first_or_create+ example, we now want the client named 'Nick':
+The +first_or_new+ method will work just like +first_or_create+ but it will not call +create+ but +new+. This means that a new model instance will be created in memory but won't be saved to the database. Continuing with the +first_or_create+ example, we now want the client named 'Nick':
<ruby>
nick = Client.where(:first_name => 'Nick').first_or_new(:locked => false)

0 comments on commit ee822f2

Please sign in to comment.