From 3386a089eff05a8a990ca56909c9a427f4f2fe25 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Sat, 10 Sep 2011 09:36:27 +0100 Subject: [PATCH] Fix warnings. Make sure we don't redefine an already-defined attribute method. --- activerecord/lib/active_record/attribute_methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index d0687ed0b68ad..1937ac4272e29 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -36,7 +36,7 @@ def instance_method_already_implemented?(method_name) @@_defined_activerecord_methods ||= defined_activerecord_methods raise DangerousAttributeError, "#{method_name} is defined by ActiveRecord" if @@_defined_activerecord_methods.include?(method_name) - @_defined_class_methods.include?(method_name) + @_defined_class_methods.include?(method_name) || generated_attribute_methods.method_defined?(method_name) end def defined_activerecord_methods