On 5 January 2012 18:09, Peter Vandenabeele <pe...@vandenabeele.com> wrote:
> If you mean "atomic" on the level of saving to the database > (all or nothing), you would need a database transaction. > > http://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html > > Second, to circumvent the problem of the uniqueness validation, > I see 2 solutions: > <snip> > Oh, it's clearer now. And, yes I have *just* saw in rails' apidocs that I should do add_index on the DB level too - to prevent possible clashes. Didn't know that until now, thanks. I guess that I will start with the first solution then. And maybe will improve it to be the latter if find the need too. Thanks, Peter! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.