aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-09-10 09:36:27 +0100
committerJon Leighton <j@jonathanleighton.com>2011-09-13 00:01:57 +0100
commit3386a089eff05a8a990ca56909c9a427f4f2fe25 (patch)
treed9b4f71b7b48e98cb05f5cf70a53d4a3c97c23a4 /activerecord
parent99bd6b53da9555450afb1e050324007868e0768c (diff)
downloadrails-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.rb2
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