From 06ddb1ab3c41ec8d4ca25006cc269488de43e2cc Mon Sep 17 00:00:00 2001 From: Diego Carrion Date: Wed, 5 Aug 2009 15:56:55 -0300 Subject: [PATCH] undefine method only if it exists --- .../lib/active_record/attribute_methods/read.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/activerecord/lib/active_record/attribute_methods/read.rb b/activerecord/lib/active_record/attribute_methods/read.rb index 0b7d6d9..1699106 100644 --- a/activerecord/lib/active_record/attribute_methods/read.rb +++ b/activerecord/lib/active_record/attribute_methods/read.rb @@ -12,7 +12,7 @@ module ActiveRecord self.attribute_types_cached_by_default = ATTRIBUTE_TYPES_CACHED_BY_DEFAULT # Undefine id so it can be used as an attribute name - undef_method :id + undef_method :id if method_defined? :id end module ClassMethods -- 1.6.0.4