diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-20 20:57:56 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-20 20:58:58 -0200 |
commit | f55bfe726045594c78438841cdccd5843522deab (patch) | |
tree | 30bb111448809e786724bf3397a2c72af3ad9fda /activemodel/README.rdoc | |
parent | 08d9c7532c7081d6b5964b8edf802fab72224cd7 (diff) | |
download | rails-f55bfe726045594c78438841cdccd5843522deab.tar.gz rails-f55bfe726045594c78438841cdccd5843522deab.tar.bz2 rails-f55bfe726045594c78438841cdccd5843522deab.zip |
Change the deprecation messages to show the preferred way to work with
ActiveModel::Errors
Diffstat (limited to 'activemodel/README.rdoc')
-rw-r--r-- | activemodel/README.rdoc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activemodel/README.rdoc b/activemodel/README.rdoc index 0985f56bfb..4920666f27 100644 --- a/activemodel/README.rdoc +++ b/activemodel/README.rdoc @@ -49,7 +49,7 @@ behavior out of the box: send("#{attr}=", nil) end end - + person = Person.new person.clear_name person.clear_age @@ -132,7 +132,7 @@ behavior out of the box: "Name" end end - + person = Person.new person.name = nil person.validate! @@ -216,10 +216,10 @@ behavior out of the box: {Learn more}[link:classes/ActiveModel/Validations.html] * Custom validators - + class HasNameValidator < ActiveModel::Validator def validate(record) - record.errors.messages[:name] << "must exist" if record.name.blank? + record.errors.add(:name, "must exist") if record.name.blank? end end |