From aa4510a7348724b01468ce9a76899012a7e41c3f Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Mon, 6 May 2013 09:49:19 -0400 Subject: [PATCH] Fix issue where RedisStore is expecting a splatted array instead of a normal one --- lib/multi_fetch_fragments.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/multi_fetch_fragments.rb b/lib/multi_fetch_fragments.rb index 6907943..a9527b0 100644 --- a/lib/multi_fetch_fragments.rb +++ b/lib/multi_fetch_fragments.rb @@ -41,7 +41,12 @@ def render_collection_with_multi_fetch_cache # cache.read_multi & cache.write interfaces may require mutable keys, ie. dalli 2.6.0 mutable_keys = keys_to_collection_map.keys.collect { |key| key.dup } - result_hash = Rails.cache.read_multi(mutable_keys) + + result_hash = if defined? ActiveSupport::Cache::RedisStore + Rails.cache.read_multi(*mutable_keys) + else + Rails.cache.read_multi(mutable_keys) + end # if we had a cached value, we don't need to render that object from the collection. # if it wasn't cached, we need to render those objects as before