Fixed UniquenessValidator error

1) Validations Uniqueness should not validate a non-unique document
     Failure/Error: @obj.errors[:title].should eql(['is already taken'])

     expected ["is already taken"]
          got ["translation missing: en.activemodel.errors.models.with_unique_validation.attributes.title.taken"]

     (compared using eql?)

     Diff:
     @@ -1,2 +1,2 @@
     -["is already taken"]
     +["translation missing: en.activemodel.errors.models.with_unique_validation.attributes.title.taken"]
     # ./spec/couchrest/validations_spec.rb:28:in `block (3 levels) in <top (required)>'

Signed-off-by: Marcos Tapajós <tapajos@gmail.com>
This commit is contained in:
Simone Carletti 2011-02-21 11:27:35 +01:00 committed by Marcos Tapajós
parent 44b56d3d03
commit f75893b927

View file

@ -32,7 +32,7 @@ module CouchRest
end
if docs.length > 0
document.errors.add(attribute, :taken, :default => options[:message], :value => value)
document.errors.add(attribute, :taken, options.merge(:value => value))
end
end