Permalink
Browse files

Fix warnings.

Make sure we don't redefine an already-defined attribute method.
  • Loading branch information...
1 parent 99bd6b5 commit 3386a089eff05a8a990ca56909c9a427f4f2fe25 @jonleighton jonleighton committed Sep 10, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 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

0 comments on commit 3386a08

Please sign in to comment.