aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorAbdelkader Boudih <terminale@gmail.com>2015-02-20 14:57:51 +0000
committerAbdelkader Boudih <terminale@gmail.com>2015-02-20 14:57:51 +0000
commit9a04558593d6926a68ab093b84d1fd3d357fc61f (patch)
treed2c6abc194e4fbbc03cf1b8ca023f18e681bbe5b /guides
parent9a476b8cd6724699027eb00ec7ffa8b232d1b734 (diff)
parent66e2e19bc03d4dc5f775848ceedb33ada75a7ace (diff)
downloadrails-9a04558593d6926a68ab093b84d1fd3d357fc61f.tar.gz
rails-9a04558593d6926a68ab093b84d1fd3d357fc61f.tar.bz2
rails-9a04558593d6926a68ab093b84d1fd3d357fc61f.zip
Merge pull request #19013 from y-yagi/custom_validators_example
use `messages` instead of deprecated `ActiveModel::Errors#[]=` method [ci skip]
Diffstat (limited to 'guides')
-rw-r--r--guides/source/active_record_validations.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/guides/source/active_record_validations.md b/guides/source/active_record_validations.md
index de26a9bd6d..31c5b07a05 100644
--- a/guides/source/active_record_validations.md
+++ b/guides/source/active_record_validations.md
@@ -1078,7 +1078,7 @@ Another way to do this is using `[]=` setter
```ruby
class Person < ActiveRecord::Base
def a_method_used_for_validation_purposes
- errors[:name] = "cannot contain the characters !@#%*()_-+="
+ errors.messages[:name] << "cannot contain the characters !@#%*()_-+="
end
end