From ee822f257e2f3f3b571772f30ae3a8edd69538c3 Mon Sep 17 00:00:00 2001 From: Nicolas Hock Isaza Date: Tue, 30 Aug 2011 15:40:09 -0500 Subject: Adding `first_or_new` documentation to the AR Querying guide. --- railties/guides/source/active_record_querying.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides') diff --git a/railties/guides/source/active_record_querying.textile b/railties/guides/source/active_record_querying.textile index 37874c2ea1..54ce7a25ab 100644 --- a/railties/guides/source/active_record_querying.textile +++ b/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': nick = Client.where(:first_name => 'Nick').first_or_new(:locked => false) -- cgit v1.2.3