diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-09 12:08:07 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-09 12:08:07 -0800 |
commit | f26fcc05f605caaa120db6af4c0e908cf8eb20c9 (patch) | |
tree | d0b88bbd5572be70994d20119f1dd8815291b659 /activerecord/lib | |
parent | f86b19842620301b969a4a264c97e5e6ebc7b67f (diff) | |
download | rails-f26fcc05f605caaa120db6af4c0e908cf8eb20c9.tar.gz rails-f26fcc05f605caaa120db6af4c0e908cf8eb20c9.tar.bz2 rails-f26fcc05f605caaa120db6af4c0e908cf8eb20c9.zip |
only exclude serialized columns from cacheable columns
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/read.rb | 6 |
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) |