# Validates\_uniqueness\_of fails on update

**URL:** <https://www.ruby-forum.com/t/validates-uniqueness-of-fails-on-update/191069>\
**Category:** Rails\
**Created:** [July 4, 2010, 5:16am UTC](https://www.ruby-forum.com/t/validates-uniqueness-of-fails-on-update/191069 "2010-07-04T05:16:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [July 4, 2010, 5:16am UTC](https://www.ruby-forum.com/t/validates-uniqueness-of-fails-on-update/191069/1 "2010-07-04T05:16:41Z")

</div>

According to the docs when you validate on uniqueness it is supposed  
to skip the check on the column. I am getting failed validation on  
updates for some reason. Rails 2.3.5

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [July 4, 2010, 11:44am UTC](https://www.ruby-forum.com/t/validates-uniqueness-of-fails-on-update/191069/2 "2010-07-04T11:44:42Z")

</div>

Please provide more information about (or just check) your migration  
and model and its associations.

In the meantime, ActiveRecord skips the check on the record/row (not  
the column) on Update. Here’s the relevant text:  
"When the record is created, a check is performed to make sure that no  
record exists in the database with the given value for the specified  
attribute (that maps to a column). When the record is updated, the  
same check is made but disregarding the record itself. "

Have you verified your data, that there is only one record in the  
table with that value?

D.
