This project is archived and is in readonly mode.
validates_uniqueness_of broken
Reported by Andre Foeken | June 7th, 2008 @ 01:50 AM
class Monkey << ActiveRecord::Base
validates_uniqueness_of :code
end
Now in console:
>> Monkey.create!( :code => "1" )
>> Monkey.create!( :code => 1 )
Comments and changes to this ticket
-
Tom Ward July 19th, 2008 @ 10:11 AM
- 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.
-
Repository July 19th, 2008 @ 04:15 PM
- 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
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>