diff options
author | thedarkone <thedarkone2@gmail.com> | 2011-07-27 18:07:47 +0200 |
---|---|---|
committer | thedarkone <thedarkone2@gmail.com> | 2011-07-27 18:07:47 +0200 |
commit | efe4cbe5f273dc5eb16dda9a9363a8dd7c6b3bad (patch) | |
tree | 4eec09f135119b44af1b2f239f594947df6c9580 /activemodel/lib/active_model | |
parent | 02691d3516e68b2de5545ec7a495024a377f89fc (diff) | |
download | rails-efe4cbe5f273dc5eb16dda9a9363a8dd7c6b3bad.tar.gz rails-efe4cbe5f273dc5eb16dda9a9363a8dd7c6b3bad.tar.bz2 rails-efe4cbe5f273dc5eb16dda9a9363a8dd7c6b3bad.zip |
Handle the empty array correctly.
Diffstat (limited to 'activemodel/lib/active_model')
-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+ |