diff options
Diffstat (limited to 'activemodel/lib')
-rw-r--r-- | activemodel/lib/active_model/attribute_methods.rb | 2 | ||||
-rw-r--r-- | activemodel/lib/active_model/errors.rb | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb index 71ab1501c8..432f3d4302 100644 --- a/activemodel/lib/active_model/attribute_methods.rb +++ b/activemodel/lib/active_model/attribute_methods.rb @@ -394,7 +394,7 @@ module ActiveModel protected def attribute_method?(attr_name) - attributes.include?(attr_name) + respond_to_without_attributes?(:attributes) && attributes.include?(attr_name) end private diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb index 025915fe6f..c6535082d3 100644 --- a/activemodel/lib/active_model/errors.rb +++ b/activemodel/lib/active_model/errors.rb @@ -99,6 +99,11 @@ module ActiveModel messages[key] = value end + # Delete messages for +key+ + def delete(key) + messages.delete(key) + end + # When passed a symbol or a name of a method, returns an array of errors # for the method. # |