mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #2393 from bdurand/fix_cache_read_multi
Fix ArgumentError in ActiveSupport::Cache::CacheStore.read_multi
This commit is contained in:
commit
6e701e8735
2 changed files with 9 additions and 1 deletions
|
@ -347,7 +347,7 @@ module ActiveSupport
|
||||||
entry = read_entry(key, options)
|
entry = read_entry(key, options)
|
||||||
if entry
|
if entry
|
||||||
if entry.expired?
|
if entry.expired?
|
||||||
delete_entry(key)
|
delete_entry(key, options)
|
||||||
else
|
else
|
||||||
results[name] = entry.value
|
results[name] = entry.value
|
||||||
end
|
end
|
||||||
|
|
|
@ -199,6 +199,14 @@ module CacheStoreBehavior
|
||||||
@cache.write('fud', 'biz')
|
@cache.write('fud', 'biz')
|
||||||
assert_equal({"foo" => "bar", "fu" => "baz"}, @cache.read_multi('foo', 'fu'))
|
assert_equal({"foo" => "bar", "fu" => "baz"}, @cache.read_multi('foo', 'fu'))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_read_multi_with_expires
|
||||||
|
@cache.write('foo', 'bar', :expires_in => 0.001)
|
||||||
|
@cache.write('fu', 'baz')
|
||||||
|
@cache.write('fud', 'biz')
|
||||||
|
sleep(0.002)
|
||||||
|
assert_equal({"fu" => "baz"}, @cache.read_multi('foo', 'fu'))
|
||||||
|
end
|
||||||
|
|
||||||
def test_read_and_write_compressed_small_data
|
def test_read_and_write_compressed_small_data
|
||||||
@cache.write('foo', 'bar', :compress => true)
|
@cache.write('foo', 'bar', :compress => true)
|
||||||
|
|
Loading…
Reference in a new issue