aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/README.rdoc
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2015-02-20 23:53:36 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2015-02-20 23:53:36 +0900
commit66e2e19bc03d4dc5f775848ceedb33ada75a7ace (patch)
treed2c6abc194e4fbbc03cf1b8ca023f18e681bbe5b /activemodel/README.rdoc
parent9a476b8cd6724699027eb00ec7ffa8b232d1b734 (diff)
downloadrails-66e2e19bc03d4dc5f775848ceedb33ada75a7ace.tar.gz
rails-66e2e19bc03d4dc5f775848ceedb33ada75a7ace.tar.bz2
rails-66e2e19bc03d4dc5f775848ceedb33ada75a7ace.zip
use `messages` instead of deprecated `ActiveModel::Errors#[]=` method [ci skip]
Diffstat (limited to 'activemodel/README.rdoc')
-rw-r--r--activemodel/README.rdoc2
1 files changed, 1 insertions, 1 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