aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2011-08-01 10:58:48 -0700
committerSantiago Pastorino <santiago@wyeworks.com>2011-08-01 10:58:48 -0700
commit6e701e8735df9bf49549e43f001af6a446148b03 (patch)
tree718202d3381c188621490d397d4d6019b6bab2f7
parent5c26f56b17ec51489c24e9a256a6d577aa94eae7 (diff)
parentfec4c5ad76a4955364e091296b68bb7ac12bc928 (diff)
downloadrails-6e701e8735df9bf49549e43f001af6a446148b03.tar.gz
rails-6e701e8735df9bf49549e43f001af6a446148b03.tar.bz2
rails-6e701e8735df9bf49549e43f001af6a446148b03.zip
Merge pull request #2393 from bdurand/fix_cache_read_multi
Fix ArgumentError in ActiveSupport::Cache::CacheStore.read_multi
-rw-r--r--activesupport/lib/active_support/cache.rb2
-rw-r--r--activesupport/test/caching_test.rb8
2 files changed, 9 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/cache.rb b/activesupport/lib/active_support/cache.rb
index 2d2264e58a..95d936b32f 100644
--- a/activesupport/lib/active_support/cache.rb
+++ b/activesupport/lib/active_support/cache.rb
@@ -347,7 +347,7 @@ module ActiveSupport
entry = read_entry(key, options)
if entry
if entry.expired?
- delete_entry(key)
+ delete_entry(key, options)
else
results[name] = entry.value
end
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb
index dff3d6ef0d..6bb13ec9b8 100644
--- a/activesupport/test/caching_test.rb
+++ b/activesupport/test/caching_test.rb
@@ -199,6 +199,14 @@ module CacheStoreBehavior
@cache.write('fud', 'biz')
assert_equal({"foo" => "bar", "fu" => "baz"}, @cache.read_multi('foo', 'fu'))
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
@cache.write('foo', 'bar', :compress => true)