aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Bigg <git@ryanbigg.com>2016-01-28 10:52:22 +1100
committerRyan Bigg <git@ryanbigg.com>2016-01-28 11:02:48 +1100
commite2ca039e5a4f819af70d794931c491b71c812335 (patch)
tree94e7faa3d64ffd633b5335bbcdae58226afd82f5
parent2c131141ca5018f41f85be429a02afac93a0241d (diff)
downloadrails-e2ca039e5a4f819af70d794931c491b71c812335.tar.gz
rails-e2ca039e5a4f819af70d794931c491b71c812335.tar.bz2
rails-e2ca039e5a4f819af70d794931c491b71c812335.zip
Slice out options for cache_fragment_name explicitly
This allows expire_in (and other options) to be passed to the cache method
-rw-r--r--actionview/lib/action_view/helpers/cache_helper.rb3
1 files changed, 2 insertions, 1 deletions
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