I'd have to say I think :one would be a better choice, or :single. I agree
with the request though. :unique brings to mind SELECT DISTINCT and is
misleading in my opinion.
Paul Bowsher


On Thu, Jul 30, 2009 at 6:22 PM, Joris <jbversch...@gmail.com> wrote:

>
> Hi guys,
>
> Pratik pointed me here. I have submitted feature request #2974.
>
> It's basically a new finder: unique. To be used at times where people
> use :first.
> Often, you query for something, and expect only a single record.
>
> To do this, people use :first. However, :first does not check for any
> following entities. This means that if the developer expects 1
> records, and gets more than 1 the application will 'just work'.
>
> I don't think this is correct behaviour. Also, :first and :last mean:
> first / last of the list. If you're looking for a single row, unique
> makes more sense
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-core+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to