aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-02-12 20:46:34 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2016-02-12 20:46:34 +0100
commita88636fa779935af5ec683fbe4b69b3229e116e7 (patch)
treea688cd7c8360adc90b135bdd8933560dd209a322 /actionview/lib/action_view
parent5bb23d3cdc81beb4f150ac0eef61e533a30e20f0 (diff)
downloadrails-a88636fa779935af5ec683fbe4b69b3229e116e7.tar.gz
rails-a88636fa779935af5ec683fbe4b69b3229e116e7.tar.bz2
rails-a88636fa779935af5ec683fbe4b69b3229e116e7.zip
Don't search in locals for cache_options.
We should only support a top level `cache_options`. We also don't have to default the options to a hash as Active Support's cache defaults that arg to nil.
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r--actionview/lib/action_view/renderer/partial_renderer/collection_caching.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/actionview/lib/action_view/renderer/partial_renderer/collection_caching.rb b/actionview/lib/action_view/renderer/partial_renderer/collection_caching.rb
index 1147963882..19d9fdf1d4 100644
--- a/actionview/lib/action_view/renderer/partial_renderer/collection_caching.rb
+++ b/actionview/lib/action_view/renderer/partial_renderer/collection_caching.rb
@@ -56,12 +56,10 @@ module ActionView
end
def fetch_or_cache_partial(cached_partials, order_by:)
- cache_options = @options[:cache_options] || @locals[:cache_options] || {}
-
order_by.map do |key|
cached_partials.fetch(key) do
yield.tap do |rendered_partial|
- collection_cache.write(key, rendered_partial, cache_options)
+ collection_cache.write(key, rendered_partial, @options[:cache_options])
end
end
end