This project is archived and is in readonly mode.
validates_uniqueness_of is case_sensitive by default
Reported by Trotter Cashion | August 22nd, 2008 @ 03:33 PM | in 2.1.2
The ActiveRecord docs claim that validates_uniqueness of is case_insensitive by default, but the code claims that it is case sensitive. See this paste from Rails 2.1 to see what I'm talking about. The bug also exists in edge.
I would prefer that validates_uniqueness_of is case_insensitive by default. I'll make a patch w/ test when I have time.
Comments and changes to this ticket
-
José Valim August 23rd, 2008 @ 04:33 PM
I think the default should be the same as the database default.
MySQL, for example, is case insensitive. I don't know if all are case insensitive.
-
Peter Wagenet August 23rd, 2008 @ 06:11 PM
As it is, it seems that either the docs or the method need to be changed.
-
Tarmo Tänav September 18th, 2008 @ 07:11 AM
- Tag changed from activerecord, bug, edge to activerecord, bug, edge
- Milestone changed from 2.x to 2.1.1
It is intended to be case sensitive by default, there is an explicit commit that says so, but somehow during a documentation mass-update in http://github.com/rails/rails/co... it got flipped to false (still correct in edge though).
-
Tarmo Tänav September 18th, 2008 @ 07:12 AM
- Milestone changed from 2.1.1 to 2.1.2
-
Tarmo Tänav September 18th, 2008 @ 10:21 PM
- State changed from new to resolved
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 498 validates_uniqueness_of: wrong default in doc Thank you for the report, but closing in favor of #883