From e2ca039e5a4f819af70d794931c491b71c812335 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Thu, 28 Jan 2016 10:52:22 +1100 Subject: [PATCH] Slice out options for cache_fragment_name explicitly This allows expire_in (and other options) to be passed to the cache method --- actionview/lib/action_view/helpers/cache_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/actionview/lib/action_view/helpers/cache_helper.rb b/actionview/lib/action_view/helpers/cache_helper.rb index 18b2102d73..401f398721 100644 --- a/actionview/lib/action_view/helpers/cache_helper.rb +++ b/actionview/lib/action_view/helpers/cache_helper.rb @@ -166,7 +166,8 @@ module ActionView # You can only declare one collection in a partial template file. def cache(name = {}, options = {}, &block) if controller.respond_to?(:perform_caching) && controller.perform_caching - safe_concat(fragment_for(cache_fragment_name(name, options), options, &block)) + name_options = options.slice(:skip_digest, :virtual_path) + safe_concat(fragment_for(cache_fragment_name(name, name_options), options, &block)) else yield end