提交 3386a089 编写于 作者: J Jon Leighton

Fix warnings.

Make sure we don't redefine an already-defined attribute method.
上级 99bd6b53
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册