When my DB insert into MySQL is denied due to a unique field that is already populated, I want to update the field called "counter" for that record so I know how many times a duplicate record tried to perform the insert. I know that MySQL has something called ON DUPLICATE KEY but I was hoping that there might already be something similar in Rails? If not, I was thinking I would have to do something like: - unless @record.save - find the ID of the duplicate record - add one to the value of the counter field for that record Any ideas would be received warmly :-) jackster -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---