# Problem validating uniqueness

**URL:** <https://www.ruby-forum.com/t/problem-validating-uniqueness/113615>\
**Category:** Rails\
**Created:** [September 2, 2007, 11:15pm UTC](https://www.ruby-forum.com/t/problem-validating-uniqueness/113615 "2007-09-02T23:15:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [September 2, 2007, 11:15pm UTC](https://www.ruby-forum.com/t/problem-validating-uniqueness/113615/1 "2007-09-02T23:15:54Z")

</div>

I have validates\_uniqueness\_of :name in my model which works fine when  
creating a record but doesn’t work when I edit the record. In other  
words it won’t let me create a record with the same name but I can go  
in after and update the field without a problem. Why would this  
happen? -Mike

---

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [September 2, 2007, 11:36pm UTC](https://www.ruby-forum.com/t/problem-validating-uniqueness/113615/2 "2007-09-02T23:36:56Z")

</div>

nevermind, figured it out. peace -mike

---

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/problem-validating-uniqueness/113615/3 "2007-09-25T23:09:49Z")

</div>

The validation was working fine. The problem was that the logic in my  
controller where I submitted the form to didn’t was flawed and so it  
didn’t indicate there had been a problem saving it. -Mike
