diff options
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/README.rdoc | 2 | ||||
-rw-r--r-- | activemodel/lib/active_model/validator.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activemodel/README.rdoc b/activemodel/README.rdoc index f6beff14e1..0985f56bfb 100644 --- a/activemodel/README.rdoc +++ b/activemodel/README.rdoc @@ -219,7 +219,7 @@ behavior out of the box: class HasNameValidator < ActiveModel::Validator def validate(record) - record.errors[:name] = "must exist" if record.name.blank? + record.errors.messages[:name] << "must exist" if record.name.blank? end end diff --git a/activemodel/lib/active_model/validator.rb b/activemodel/lib/active_model/validator.rb index b98585912e..5752771d8c 100644 --- a/activemodel/lib/active_model/validator.rb +++ b/activemodel/lib/active_model/validator.rb @@ -15,7 +15,7 @@ module ActiveModel # class MyValidator < ActiveModel::Validator # def validate(record) # if some_complex_logic - # record.errors[:base] = "This record is invalid" + # record.errors.messages[:base] << "This record is invalid" # end # end # |