@@ -1018,7 +1018,7 @@ If you want to find both by name and locked, you can chain these finders togethe
WARNING: Up to and including Rails 3.1, when the number of arguments passed to a dynamic finder method is lesser than the number of fields, say <tt>Client.find_by_name_and_locked("Ryan")</tt>, the behavior is to pass +nil+ as the missing argument. This is *unintentional* and this behavior will be changed in Rails 3.2 to throw an +ArgumentError+.
-h3. Find or create
+h3. Find or build a new object
It's common that you need to find a record or create it if it doesn't exist. You can do that with the +first_or_create+ and +first_or_create!+ methods.
NOTE: Be sure to check the extensive *Active Record Validations and Callbacks Guide* for more information about validations.
-h3. 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':
@@ -1089,10 +1089,10 @@ SELECT * FROM clients WHERE (clients.first_name = 'Nick') LIMIT 1
When you want to save it to the database, just call +save+:
-# => true
+# => true
Just like you can use *+build+* instead of *+new+*, you can use *+first_or_build+* instead of *+first_or_new+*.