diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-09-10 09:36:27 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-09-13 00:01:57 +0100 |
commit | 3386a089eff05a8a990ca56909c9a427f4f2fe25 (patch) | |
tree | d9b4f71b7b48e98cb05f5cf70a53d4a3c97c23a4 /activerecord | |
parent | 99bd6b53da9555450afb1e050324007868e0768c (diff) | |
download | rails-3386a089eff05a8a990ca56909c9a427f4f2fe25.tar.gz rails-3386a089eff05a8a990ca56909c9a427f4f2fe25.tar.bz2 rails-3386a089eff05a8a990ca56909c9a427f4f2fe25.zip |
Fix warnings.
Make sure we don't redefine an already-defined attribute method.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index d0687ed0b6..1937ac4272 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -36,7 +36,7 @@ module ActiveRecord @@_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 |