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 case_sensitive by default

#883

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.

Reported by Trotter Cashion · August 22nd, 2008 @ 03:33 PM

State: resolved
Milestone: 2.1.2
Assigned to: nobody
Importance: Medium

Activity

  1. José Valim
    José Valim

    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.

    August 23rd, 2008 @ 04:33 PM

  2. Peter Wagenet
    Peter Wagenet

    As it is, it seems that either the docs or the method need to be changed.

    August 23rd, 2008 @ 06:11 PM

  3. Tarmo Tänav
    Tarmo Tänav
    • 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).

    September 18th, 2008 @ 07:11 AM

  4. Tarmo Tänav
    Tarmo Tänav
    • Milestone changed from 2.1.1 to 2.1.2

    September 18th, 2008 @ 07:12 AM

  5. Tarmo Tänav
    Tarmo Tänav
    • State changed from new to resolved

    September 18th, 2008 @ 10:21 PM