On Oct 31, 2010, at 12:08 PM, Xavier Noria wrote: > If one cares about this edge case, I think the best approach is the > one we use for model IDs: let the database take care of it. Set a > UNIQUE constraint, and deal with it in the application. > > Perhaps you could even wrap AR::Base#save in your application so that > if violation of that constraint is detected (assuming the exception > has information that allows you to do that), you intercept it and > build a regular validation error on the model. Just off the top of my > head, have not written it.
Some other folks have. :) https://rails.lighthouseapp.com/projects/8994/tickets/3486 --Matt Jones -- 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.
