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 broken

#361
class Monkey << ActiveRecord::Base
  validates_uniqueness_of :code
end

Now in console:

>> Monkey.create!( :code => "1" )
>> Monkey.create!( :code => 1 )

Reported by Andre Foeken · June 7th, 2008 @ 01:50 AM

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Tom Ward
    Tom Ward
    • Tag set to activerecord, bug, patch

    Problem was that in some cases value is compared against database result, but not first converted to string. Here's a patch to rectify this.

    July 19th, 2008 @ 10:11 AM

  2. Repository
    Repository
    • State changed from new to resolved
    • Tag changed from activerecord, bug, patch to activerecord, bug, patch, tiny

    (from [f2059393481ceb632abc7a9d92670e409020d5bd]) Ensure checked value is a string when validating case-sensitive uniqueness [#361 state:resolved]

    Signed-off-by: Pratik Naik

    http://github.com/rails/rails/co...

    July 19th, 2008 @ 04:15 PM