-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
I'm not sure if this is intentional with Mongoid (it's not on http://mongoid.org/docs/validation.html if it is) or not but it's different behaviour from AR.
Basicly: take two records (Artist) with a uniqueness constraint on :name field. Both persisted to db with the same name. Using AR:
>> Artist.first.valid?
false
Mongoid:
>> Artist.first.valid?
true
I discovered this with validates_uniqueness_of. Not sure if it happens with other types of validations.
Mongoid 2.4.8 - ruby 1.9.3p125