diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2014-01-23 08:30:04 -0800 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2014-01-23 08:30:04 -0800 |
commit | a7680ab47ddaf3f963824a72a130e2b18fbd1195 (patch) | |
tree | 351c2a7b3422d92c07400c19dfe6bd470b9e3e47 /activemodel/lib/active_model/errors.rb | |
parent | 6ef0569b0bf6e13d63f6c51790745b2007b92973 (diff) | |
parent | db95c7dcebcd240ba46cc5df4eb2b8f240f497bb (diff) | |
download | rails-a7680ab47ddaf3f963824a72a130e2b18fbd1195.tar.gz rails-a7680ab47ddaf3f963824a72a130e2b18fbd1195.tar.bz2 rails-a7680ab47ddaf3f963824a72a130e2b18fbd1195.zip |
Merge pull request #13795 from bobbus/errors-has-key
Fix ActiveModel::Errors#has_key? returning nil
Diffstat (limited to 'activemodel/lib/active_model/errors.rb')
-rw-r--r-- | activemodel/lib/active_model/errors.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb index 010c4bb6f9..9c3bc913e1 100644 --- a/activemodel/lib/active_model/errors.rb +++ b/activemodel/lib/active_model/errors.rb @@ -94,7 +94,7 @@ module ActiveModel # person.errors.include?(:name) # => true # person.errors.include?(:age) # => false def include?(attribute) - (v = messages[attribute]) && v.any? + messages[attribute].present? end # aliases include? alias :has_key? :include? |