On 16/04/2011, at 7:54 AM, Corin Langosch <[email protected]> wrote: > This change should not have any backwards compatibility issues because a > named finder with a query which selects more than one row is never desired > and a sign for bad design. > > What do you think? >
It doesn't have backwards compatibility in terms of the values returned to a user, however it would have significantly difference performance characteristics. Removing the limit will make the database examine multiple rows, lots of them in your case, which won't be ideal. The dynamic finders are currently a small piece of syntactic sugar for 'where x = ? limit 1', I'm not sure that changing them to do something more complete really gains us much. An easier fix for your case would be a unique index, and a model method which raises ArgmentError when passed null. > Corin > > -- > 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > -- Cheers, Koz -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
