diff options
author | thedarkone <thedarkone2@gmail.com> | 2011-07-27 18:07:47 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-13 16:22:20 -0700 |
commit | 45f9c2b3619d96867f9c6af7c16d2f5d53f1a17e (patch) | |
tree | c8e8ebfa961e75f3801ad0c566e057f52cff23c5 /activemodel/lib | |
parent | 035d31bd93d68724912d656e03cba7c6b503d25a (diff) | |
download | rails-45f9c2b3619d96867f9c6af7c16d2f5d53f1a17e.tar.gz rails-45f9c2b3619d96867f9c6af7c16d2f5d53f1a17e.tar.bz2 rails-45f9c2b3619d96867f9c6af7c16d2f5d53f1a17e.zip |
Handle the empty array correctly.
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 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+ |