Change Uniqueness validator message to follow ActiveRecord and other ORM behavior. Keeping the same message allows tools like Shoulda to work out of the box.

Signed-off-by: Marcos Tapajós <tapajos@gmail.com>
This commit is contained in:
Simone Carletti 2011-02-21 11:41:40 +01:00 committed by Marcos Tapajós
parent f76517d0fa
commit 44b56d3d03
2 changed files with 2 additions and 2 deletions

View file

@ -1,5 +1,5 @@
en: en:
errors: errors:
messages: messages:
taken: "is already taken" taken: "has already been taken"

View file

@ -25,7 +25,7 @@ describe "Validations" do
it "should not validate a non-unique document" do it "should not validate a non-unique document" do
@obj = WithUniqueValidation.create(:title => 'title 1') @obj = WithUniqueValidation.create(:title => 'title 1')
@obj.should_not be_valid @obj.should_not be_valid
@obj.errors[:title].should eql(['is already taken']) @obj.errors[:title].should == ["has already been taken"]
end end
it "should save already created document" do it "should save already created document" do