From f26fcc05f605caaa120db6af4c0e908cf8eb20c9 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 9 Feb 2012 12:08:07 -0800 Subject: only exclude serialized columns from cacheable columns --- activerecord/lib/active_record/attribute_methods/read.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/attribute_methods/read.rb') diff --git a/activerecord/lib/active_record/attribute_methods/read.rb b/activerecord/lib/active_record/attribute_methods/read.rb index 88c81b2e01..0724082a2d 100644 --- a/activerecord/lib/active_record/attribute_methods/read.rb +++ b/activerecord/lib/active_record/attribute_methods/read.rb @@ -88,7 +88,11 @@ module ActiveRecord private def cacheable_column?(column) - attribute_types_cached_by_default.include?(column.type) + if attribute_types_cached_by_default == ATTRIBUTE_TYPES_CACHED_BY_DEFAULT + ! serialized_attributes.include? column.name + else + attribute_types_cached_by_default.include?(column.type) + end end def internal_attribute_access_code(attr_name, cast_code) -- cgit v1.2.3