diff options
author | Ryan Bigg <radarlistener@gmail.com> | 2008-10-22 21:46:49 +1030 |
---|---|---|
committer | Ryan Bigg <radarlistener@gmail.com> | 2008-10-22 21:46:49 +1030 |
commit | 4a53eb8a79e3e0535ba19e6da38370a542ce4961 (patch) | |
tree | 965418cb69895e44879c7b1fa428e808b91aa66a /activesupport/lib/active_support/cache/compressed_mem_cache_store.rb | |
parent | a325010d6c9b2c69cab5da046e1106aad491b73f (diff) | |
parent | 303919c62660c68ca450a53ec5ef29ec2c615b7a (diff) | |
download | rails-4a53eb8a79e3e0535ba19e6da38370a542ce4961.tar.gz rails-4a53eb8a79e3e0535ba19e6da38370a542ce4961.tar.bz2 rails-4a53eb8a79e3e0535ba19e6da38370a542ce4961.zip |
Merge branch 'master' of git@github.com:lifo/docrails
Diffstat (limited to 'activesupport/lib/active_support/cache/compressed_mem_cache_store.rb')
-rw-r--r-- | activesupport/lib/active_support/cache/compressed_mem_cache_store.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/cache/compressed_mem_cache_store.rb b/activesupport/lib/active_support/cache/compressed_mem_cache_store.rb index 0bff6cf9ad..d87eb17337 100644 --- a/activesupport/lib/active_support/cache/compressed_mem_cache_store.rb +++ b/activesupport/lib/active_support/cache/compressed_mem_cache_store.rb @@ -3,12 +3,17 @@ module ActiveSupport class CompressedMemCacheStore < MemCacheStore def read(name, options = nil) if value = super(name, (options || {}).merge(:raw => true)) - Marshal.load(ActiveSupport::Gzip.decompress(value)) + if raw?(options) + value + else + Marshal.load(ActiveSupport::Gzip.decompress(value)) + end end end def write(name, value, options = nil) - super(name, ActiveSupport::Gzip.compress(Marshal.dump(value)), (options || {}).merge(:raw => true)) + value = ActiveSupport::Gzip.compress(Marshal.dump(value)) unless raw?(options) + super(name, value, (options || {}).merge(:raw => true)) end end end |