Rescuing From RecordNotUnique

/ Published in: Rails
Save to your folder(s)

Use rescue_from ActiveRecord::RecordNotUnique when DB transaction fail on uniqueness check

Copy this code and paste it in your HTML
  1. rescue_from ActiveRecord::RecordNotUnique, :with => :my_rescue_method
  2. ....
  3. protected
  4. def my_rescue_method
  5. ...
  6. end

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.