diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-01-29 00:15:49 -0500 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-01-29 00:16:36 -0500 |
commit | 4de092240004e31c512810b19e1b7a83e1ddc77e (patch) | |
tree | f39d53793d4cbed67f0ca5848609976fab265c80 | |
parent | f16709231de2df863949e8e99a5b0fe22695fd15 (diff) | |
parent | e2ca039e5a4f819af70d794931c491b71c812335 (diff) | |
download | rails-4de092240004e31c512810b19e1b7a83e1ddc77e.tar.gz rails-4de092240004e31c512810b19e1b7a83e1ddc77e.tar.bz2 rails-4de092240004e31c512810b19e1b7a83e1ddc77e.zip |
Merge pull request #23296 from radar/cache-fragment-name-options
Extract options for cache_fragment_name method to allow expires_in on cache method
-rw-r--r-- | actionview/lib/action_view/helpers/cache_helper.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actionview/lib/action_view/helpers/cache_helper.rb b/actionview/lib/action_view/helpers/cache_helper.rb index 2e30578123..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 @@ -208,7 +209,7 @@ module ActionView # # The digest will be generated using +virtual_path:+ if it is provided. # - def cache_fragment_name(name = {}, skip_digest: nil, virtual_path: nil, **_options) + def cache_fragment_name(name = {}, skip_digest: nil, virtual_path: nil) if skip_digest name else |