aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/errors.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-02-09 09:19:15 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-02-09 09:19:56 -0800
commitf48d32c0cff36cb505443ff72738def3a82c2886 (patch)
treeb988980a20d287f9b6279a5d26e8d890a2e0a866 /activemodel/lib/active_model/errors.rb
parent39310f7930185ed415221607ee0188b692794ea7 (diff)
downloadrails-f48d32c0cff36cb505443ff72738def3a82c2886.tar.gz
rails-f48d32c0cff36cb505443ff72738def3a82c2886.tar.bz2
rails-f48d32c0cff36cb505443ff72738def3a82c2886.zip
implementing include? on AM::Errors
Diffstat (limited to 'activemodel/lib/active_model/errors.rb')
-rw-r--r--activemodel/lib/active_model/errors.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb
index 003c94a409..5e3cf510b0 100644
--- a/activemodel/lib/active_model/errors.rb
+++ b/activemodel/lib/active_model/errors.rb
@@ -84,6 +84,11 @@ module ActiveModel
messages.clear
end
+ # Do the error messages include an error with key +error+?
+ def include?(error)
+ messages.include? error
+ end
+
# Get messages for +key+
def get(key)
messages[key]