1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Slice out options for cache_fragment_name explicitly

This allows expire_in (and other options) to be passed to the cache method
This commit is contained in:
Ryan Bigg 2016-01-28 10:52:22 +11:00
parent 2c131141ca
commit e2ca039e5a

View file

@ -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