From 37c19f7ebcf542af968a4983b3296b9fa283a0dc Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Wed, 10 Jun 2020 09:25:03 +0900 Subject: [PATCH] Fix Active Support failure for redis 4.2.0 with Ruby 2.8.0-dev --- Gemfile.lock | 2 +- activesupport/lib/active_support/cache/redis_cache_store.rb | 2 +- activesupport/test/cache/stores/redis_cache_store_test.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3eae0f1ebd7..cd255cb9e97 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -386,7 +386,7 @@ GEM ffi (~> 1.0) rdoc (6.2.1) redcarpet (3.2.3) - redis (4.1.3) + redis (4.2.0) redis-namespace (1.7.0) redis (>= 3.0.4) regexp_parser (1.6.0) diff --git a/activesupport/lib/active_support/cache/redis_cache_store.rb b/activesupport/lib/active_support/cache/redis_cache_store.rb index 8183f2a73e7..0154d143586 100644 --- a/activesupport/lib/active_support/cache/redis_cache_store.rb +++ b/activesupport/lib/active_support/cache/redis_cache_store.rb @@ -398,7 +398,7 @@ module ActiveSupport modifiers[:nx] = unless_exist modifiers[:px] = (1000 * expires_in.to_f).ceil if expires_in - redis.with { |c| c.set key, serialized_entry, modifiers } + redis.with { |c| c.set key, serialized_entry, **modifiers } else redis.with { |c| c.set key, serialized_entry } end diff --git a/activesupport/test/cache/stores/redis_cache_store_test.rb b/activesupport/test/cache/stores/redis_cache_store_test.rb index b8d8cf76b5e..410fda20e31 100644 --- a/activesupport/test/cache/stores/redis_cache_store_test.rb +++ b/activesupport/test/cache/stores/redis_cache_store_test.rb @@ -290,7 +290,7 @@ module ActiveSupport::Cache::RedisCacheStoreTests @cache.redis.set("fu", "baz") @cache.clear assert_not @cache.exist?("foo") - assert @cache.redis.exists("fu") + assert @cache.redis.exists?("fu") end test "clear all cache key with Redis::Distributed" do