On 21 April 2016 at 23:21, Meenakshi Sharma <[email protected]> wrote: > Hi all, > > I am running into 'concurrent POST requests' issue in the application that I > would like to handle. > It's resulting in duplicate entries in database for columns with indexes. > > I am thinking of adding unique constraint to the table columns (with index) > and handle resulting database errors in the application.
If you have a uniqueness validation then you should always also enforce that in the database, for exactly the reason you describe. See http://guides.rubyonrails.org/active_record_validations.html#uniqueness Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLujNYGaproqOjyWk0XAYCuUm3WOcGsmMsqR%3DPfpbYKS0w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

