Permalink
Browse files

Revert "Merge pull request #4196 from gazay/3-2-stable-marshalling"

This reverts commit df37018, reversing
changes made to a0fd9fb.
  • Loading branch information...
1 parent 50af25b commit 80f2eeb138c4a7901b7b015a6f56445902a9f1ab @tenderlove tenderlove committed Dec 29, 2011
Showing with 1 addition and 26 deletions.
  1. +1 −11 activesupport/lib/active_support/cache.rb
  2. +0 −15 activesupport/test/caching_test.rb
@@ -578,17 +578,7 @@ def value
# 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
@@ -220,21 +220,6 @@ def test_should_read_and_write_false
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')

0 comments on commit 80f2eeb

Please sign in to comment.