title: How to handle ActiveRecord::RecordNotUnique in Rails properly
body: <p>I am trying to enforce uniqueness with unique index in my Rails project. And I found something confusing.</p>
  
  <p>Like registering a user at my site, you need to provide an email address and a nickname, both need to be unique. I add unique index to both email and nickname. And when duplications come, I rescue exception <code>ActiveRecord::RecordNotUnique</code>, now here's the question, how could I know which field cause the exception?</p>
  
  <p>Thanks a lot for the help.</p>