aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2011-07-27 09:44:15 -0700
committerSantiago Pastorino <santiago@wyeworks.com>2011-07-27 09:44:15 -0700
commitfa2bfd832c1d1e997d93c2269a485cc74782c86d (patch)
tree8cb6d799b2853de3554794c3b5fe646dadc9a373 /activemodel/lib
parent8faeed1d7174cc9c357dbf55bb55d8a1a221eaca (diff)
parentefe4cbe5f273dc5eb16dda9a9363a8dd7c6b3bad (diff)
downloadrails-fa2bfd832c1d1e997d93c2269a485cc74782c86d.tar.gz
rails-fa2bfd832c1d1e997d93c2269a485cc74782c86d.tar.bz2
rails-fa2bfd832c1d1e997d93c2269a485cc74782c86d.zip
Merge pull request #2305 from thedarkone/errors-include
Improve AM::Errors#include?
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/errors.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb
index 71ece15b71..1cf8144e98 100644
--- a/activemodel/lib/active_model/errors.rb
+++ b/activemodel/lib/active_model/errors.rb
@@ -86,7 +86,7 @@ module ActiveModel
# Do the error messages include an error with key +error+?
def include?(error)
- messages.include? error
+ (v = messages[error]) && v.any?
end
# Get messages for +key+