If you want reliable uniqueness on a field, a DB-level constraint is necessary. But DB-level constraints are not reflected in #errors like other validations. We implemented this in an around_filter at my work, would core be interested in a PR? I'm pretty open to whatever API people want-the most unobtrusive one I can think of would be to add an option to validates_uniqueness_of, perhaps :enforced_in_db or something like that.
Unrelated: server clocks tend to drift, so often the created_at timestamps of a set of AR objects sort in a different order than their ids. It wouldn't be terribly hard to use select now() instead of Time.now for those timestamps. Any interest in a PR for that? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at https://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/d/optout.