From bf62077369ba9c35353d046653046d5f5d7dd8f7 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 24 Aug 2012 15:17:38 -0700 Subject: call methods on AR::Model after ClassMethods module is defined --- activerecord/lib/active_record/attribute_methods/read.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/attribute_methods/read.rb b/activerecord/lib/active_record/attribute_methods/read.rb index a7af086e43..5fd139156c 100644 --- a/activerecord/lib/active_record/attribute_methods/read.rb +++ b/activerecord/lib/active_record/attribute_methods/read.rb @@ -8,7 +8,6 @@ module ActiveRecord extend ActiveSupport::Concern ATTRIBUTE_TYPES_CACHED_BY_DEFAULT = [:datetime, :timestamp, :time, :date] - ActiveRecord::Model.attribute_types_cached_by_default = ATTRIBUTE_TYPES_CACHED_BY_DEFAULT included do config_attribute :attribute_types_cached_by_default @@ -64,6 +63,8 @@ module ActiveRecord end end + ActiveRecord::Model.attribute_types_cached_by_default = ATTRIBUTE_TYPES_CACHED_BY_DEFAULT + # Returns the value of the attribute identified by attr_name after it has been typecast (for example, # "2004-12-12" in a data column is cast to a date object, like Date.new(2004, 12, 12)). def read_attribute(attr_name) -- cgit v1.2.3