diff options
author | Rei <chloerei@gmail.com> | 2018-04-15 00:43:14 +0800 |
---|---|---|
committer | Rei <chloerei@gmail.com> | 2018-04-15 00:43:14 +0800 |
commit | 92db9e46f8dced015a236f073187e4ea50c7e13c (patch) | |
tree | fd5970063a29a0d2386d6b478b9e6b8832e2eaf4 /activesupport/lib | |
parent | 662ba236d115d3e2152b04dcdefdc0ee6f1f6102 (diff) | |
download | rails-92db9e46f8dced015a236f073187e4ea50c7e13c.tar.gz rails-92db9e46f8dced015a236f073187e4ea50c7e13c.tar.bz2 rails-92db9e46f8dced015a236f073187e4ea50c7e13c.zip |
Fix redis store clear keys outside the namespace
Namespace not working in RedisCacheStore#clear method. Bacause
namespace = merged_options(options)[namespace]
is always nil, Correct is
namespace = merged_options(options)[:namespace]
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/cache/redis_cache_store.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/cache/redis_cache_store.rb b/activesupport/lib/active_support/cache/redis_cache_store.rb index a1cb6db25d..74f935e02e 100644 --- a/activesupport/lib/active_support/cache/redis_cache_store.rb +++ b/activesupport/lib/active_support/cache/redis_cache_store.rb @@ -286,7 +286,7 @@ module ActiveSupport # Failsafe: Raises errors. def clear(options = nil) failsafe :clear do - if namespace = merged_options(options)[namespace] + if namespace = merged_options(options)[:namespace] delete_matched "*", namespace: namespace else redis.with { |c| c.flushdb } |