aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-12-28 16:55:41 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-12-28 16:55:41 -0800
commit80f2eeb138c4a7901b7b015a6f56445902a9f1ab (patch)
treec92c067e5788f4ae44dd6acfba486f2c1098e73b
parent50af25ba87a0814d9c38984218c5e157a07f86cd (diff)
downloadrails-80f2eeb138c4a7901b7b015a6f56445902a9f1ab.tar.gz
rails-80f2eeb138c4a7901b7b015a6f56445902a9f1ab.tar.bz2
rails-80f2eeb138c4a7901b7b015a6f56445902a9f1ab.zip
Revert "Merge pull request #4196 from gazay/3-2-stable-marshalling"
This reverts commit df3701872d6c97ff49943aea30761b47e60fa9fe, reversing changes made to a0fd9fb01730af12d66a27b5665cc010bd3b90b4.
-rw-r--r--activesupport/lib/active_support/cache.rb12
-rw-r--r--activesupport/test/caching_test.rb15
2 files changed, 1 insertions, 26 deletions
diff --git a/activesupport/lib/active_support/cache.rb b/activesupport/lib/active_support/cache.rb
index 6ba0a600b1..7d032ca984 100644
--- a/activesupport/lib/active_support/cache.rb
+++ b/activesupport/lib/active_support/cache.rb
@@ -578,17 +578,7 @@ module ActiveSupport
# it is marshalled and eventually compressed. Both operations yield
# strings.
if @value
- # In rails 3.1 and earlier values in entries did not marshaled without
- # options[:compress] and if it's Numeric.
- # But after commit a263f377978fc07515b42808ebc1f7894fafaa3a
- # all values in entries are marshalled. And after that code below expects
- # that all values in entries will be marshaled (and will be strings).
- # So here we need a check for old ones.
- begin
- Marshal.load(compressed? ? Zlib::Inflate.inflate(@value) : @value)
- rescue
- compressed? ? Zlib::Inflate.inflate(@value) : @value
- end
+ Marshal.load(compressed? ? Zlib::Inflate.inflate(@value) : @value)
end
end
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb
index 3f41f80c3a..5488070d8c 100644
--- a/activesupport/test/caching_test.rb
+++ b/activesupport/test/caching_test.rb
@@ -220,21 +220,6 @@ module CacheStoreBehavior
assert_equal false, @cache.read('foo')
end
- def test_should_read_cached_numeric_from_previous_rails_versions
- @old_cache = ActiveSupport::Cache::Entry.create( 1, Time.now )
- assert_equal( 1, @old_cache.value )
- end
-
- def test_should_read_cached_hash_from_previous_rails_versions
- @old_cache = ActiveSupport::Cache::Entry.create( {}, Time.now )
- assert_equal( {}, @old_cache.value )
- end
-
- def test_should_read_cached_string_from_previous_rails_versions
- @old_cache = ActiveSupport::Cache::Entry.create( 'string', Time.now )
- assert_equal( 'string', @old_cache.value )
- end
-
def test_read_multi
@cache.write('foo', 'bar')
@cache.write('fu', 'baz')