This project is archived and is in readonly mode.
validates_uniqueness_of is unicode unaware
Reported by Eugene Pimenov | August 29th, 2008 @ 11:50 AM | in 2.x
Validate_uniqueness in case insensitive mode use downcase which is unicode-unaware. With an unicode aware database, lower(field) != downcased value so it fails to validate anything.
The patch is a simple one-liner.
In the test “Topic.find(t_utf8, :select => 'LOWER(title) AS title').title == "я тоже уникальный!"” checks unicode awareness of database. For example, In MySQL “alter database activerecord_unittest charset=utf8” make this condition true, and “alter database activerecord_unittest charset=latin1” make it false.
Comments and changes to this ticket
-
Tarmo Tänav August 29th, 2008 @ 07:49 PM
- State changed from new to resolved
-
Repository August 29th, 2008 @ 08:01 PM
(from [184ae2ccb49f0e408fe7d9ba7fe2d1bc5470bc8a]) Make case insensitive validates_uniqueness_of use unicode aware downcase method. [#932 state:resolved]
Signed-off-by: Michael Koziarski michael@koziarski.com
Conflicts:
activerecord/lib/active_record/validations.rb
Signed-off-by: Tarmo Tänav tarmo@itech.ee http://github.com/rails/rails/co...
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
- 932 validates_uniqueness_of is unicode unaware (from [184ae2ccb49f0e408fe7d9ba7fe2d1bc5470bc8a]) Make ca...