diff options
author | Adrien Coquio <adrien.coquio@gmail.com> | 2014-01-22 15:49:31 +0100 |
---|---|---|
committer | Adrien Coquio <adrien.coquio@gmail.com> | 2014-01-22 21:01:41 +0100 |
commit | b97035df64f5b2f912425c4a7fcb6e6bb3ddab8d (patch) | |
tree | 5519f51b08f0c7c23985e197316516988bec64b3 /activemodel/lib | |
parent | 1c2c5527032f7a79aff53d29e9640e27957f1b49 (diff) | |
download | rails-b97035df64f5b2f912425c4a7fcb6e6bb3ddab8d.tar.gz rails-b97035df64f5b2f912425c4a7fcb6e6bb3ddab8d.tar.bz2 rails-b97035df64f5b2f912425c4a7fcb6e6bb3ddab8d.zip |
Fix ActiveModel::Errors#has_key? return value
Diffstat (limited to 'activemodel/lib')
-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? |