Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

validates_uniqueness_of is unicode unaware

#932

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.

Reported by Eugene Pimenov · August 29th, 2008 @ 11:50 AM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. José Valim
  2. Tarmo Tänav
  3. Repository
    Repository

    (from [184ae2ccb49f0e408fe7d9ba7fe2d1bc5470bc8a]) Make case insensitive validates_uniqueness_of use unicode aware downcase method. [#932 validates_uniqueness_of is unicode unaware 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...

    August 29th, 2008 @ 08:01 PM