From 53cd102b39eb62567298430cbd94e40dd78d46a0 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Tue, 24 Feb 2009 12:29:25 +0000 Subject: Merge with docrails --- railties/guides/source/2_2_release_notes.textile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'railties/guides/source/2_2_release_notes.textile') diff --git a/railties/guides/source/2_2_release_notes.textile b/railties/guides/source/2_2_release_notes.textile index 6f882f6d7d..f60af01050 100644 --- a/railties/guides/source/2_2_release_notes.textile +++ b/railties/guides/source/2_2_release_notes.textile @@ -164,9 +164,9 @@ h4. New Dynamic Finders Two new sets of methods have been added to Active Record's dynamic finders family. -h5. +find_last_by_+ +h5. +find_last_by_attribute+ -The +find_last_by_+ method is equivalent to +Model.last(:conditions => {:attribute => value})+ +The +find_last_by_attribute+ method is equivalent to +Model.last(:conditions => {:attribute => value})+ # Get the last user who signed up from London @@ -175,9 +175,9 @@ User.find_last_by_city('London') * Lead Contributor: "Emilio Tagua":http://www.workingwithrails.com/person/9147-emilio-tagua -h5. +find_by_!+ +h5. +find_by_attribute!+ -The new bang! version of +find_by_!+ is equivalent to +Model.first(:conditions => {:attribute => value}) || raise ActiveRecord::RecordNotFound+ Instead of returning +nil+ if it can't find a matching record, this method will raise an exception if it cannot find a match. +The new bang! version of +find_by_attribute!+ is equivalent to +Model.first(:conditions => {:attribute => value}) || raise ActiveRecord::RecordNotFound+ Instead of returning +nil+ if it can't find a matching record, this method will raise an exception if it cannot find a match. # Raise ActiveRecord::RecordNotFound exception if 'Moby' hasn't signed up yet! -- cgit v1.2.3