Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion :throw option for AR finders that don't throw RecordNotFound exceptions
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Michael Koziarski  
View profile  
 More options Aug 30 2006, 12:55 am
From: "Michael Koziarski" <mich...@koziarski.com>
Date: Wed, 30 Aug 2006 16:55:45 +1200
Local: Wed, Aug 30 2006 12:55 am
Subject: Re: [Rails-core] Re: :throw option for AR finders that don't throw RecordNotFound exceptions

> Isn't find_by_name handled in method missing? Could we add a check for
> a bang at the end so:

> @tag.find_by_name # => doesn't throw if nil
> @tag.find_by_name! # => throws with nil

> PDI

I prefer the bang approach to the :some_hash_key thing.  In the past
I've wanted:

Whatever.find(:one, ...) which is like find first but throws for <> 1
rows....  But this seems like a nice middle ground.

--
Cheers

Koz


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google