aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods/read.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-02-09 12:08:07 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2012-02-09 12:08:07 -0800
commitf26fcc05f605caaa120db6af4c0e908cf8eb20c9 (patch)
treed0b88bbd5572be70994d20119f1dd8815291b659 /activerecord/lib/active_record/attribute_methods/read.rb
parentf86b19842620301b969a4a264c97e5e6ebc7b67f (diff)
downloadrails-f26fcc05f605caaa120db6af4c0e908cf8eb20c9.tar.gz
rails-f26fcc05f605caaa120db6af4c0e908cf8eb20c9.tar.bz2
rails-f26fcc05f605caaa120db6af4c0e908cf8eb20c9.zip
only exclude serialized columns from cacheable columns
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods/read.rb')
-rw-r--r--activerecord/lib/active_record/attribute_methods/read.rb6
1 files changed, 5 insertions, 1 deletions
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)