aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorRobson Marques <robsonmarques@gmail.com>2014-12-19 15:26:41 -0200
committerRobson Marques <robsonmarques@gmail.com>2014-12-22 09:06:30 -0200
commitebaf4e40cdcb80ebe16014a2c979f688213d7b92 (patch)
tree0c0c47849af87868b7dc80f975a639262a490711 /activemodel/lib
parenta407bb245b0f5888c93dd98265e0f3b2cb35ef20 (diff)
downloadrails-ebaf4e40cdcb80ebe16014a2c979f688213d7b92.tar.gz
rails-ebaf4e40cdcb80ebe16014a2c979f688213d7b92.tar.bz2
rails-ebaf4e40cdcb80ebe16014a2c979f688213d7b92.zip
Fix inaccurate docs in active_model errors [ci skip]
The default value for the argument `message` in `ActiveModel::Errors#add` has a new behavior since ca99ab2481d44d67bc392d0ec1125ff1439e9f94. Before person.errors.add(:name, nil) # => ["is invalid"] After person.errors.add(:name, nil) # => [nil]
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/errors.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb
index 9105ef5dd6..55687cb3c7 100644
--- a/activemodel/lib/active_model/errors.rb
+++ b/activemodel/lib/active_model/errors.rb
@@ -283,9 +283,9 @@ module ActiveModel
# ActiveModel::StrictValidationFailed instead of adding the error.
# <tt>:strict</tt> option can also be set to any other exception.
#
- # person.errors.add(:name, nil, strict: true)
+ # person.errors.add(:name, :invalid, strict: true)
# # => ActiveModel::StrictValidationFailed: name is invalid
- # person.errors.add(:name, nil, strict: NameIsInvalid)
+ # person.errors.add(:name, :invalid, strict: NameIsInvalid)
# # => NameIsInvalid: name is invalid
#
# person.errors.messages # => {}