aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/renderer
diff options
context:
space:
mode:
authorRoque Pinel <repinel@gmail.com>2015-06-12 15:30:04 -0400
committerRoque Pinel <repinel@gmail.com>2015-06-28 20:41:59 -0500
commitda1674576d01f8fe3ad3b448a4c3fa636bcce106 (patch)
tree5de420942c36f327b435761fba41a0f37ac80995 /actionview/lib/action_view/renderer
parentaba43b7da1f45465fc3753225e5c73046342d4ec (diff)
downloadrails-da1674576d01f8fe3ad3b448a4c3fa636bcce106.tar.gz
rails-da1674576d01f8fe3ad3b448a4c3fa636bcce106.tar.bz2
rails-da1674576d01f8fe3ad3b448a4c3fa636bcce106.zip
Fix cache issue when different partials use the same collection
Adds the `virtual_path` option to `cache_fragment_name` so it can be provided when needed. That allows `cache_collection_render` to get the appropriate cache key with the digest generated based on the template and prevent collision with other templates that cache the same collection.
Diffstat (limited to 'actionview/lib/action_view/renderer')
-rw-r--r--actionview/lib/action_view/renderer/partial_renderer/collection_caching.rb2
1 files changed, 1 insertions, 1 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 c8268e226e..1147963882 100644
--- a/actionview/lib/action_view/renderer/partial_renderer/collection_caching.rb
+++ b/actionview/lib/action_view/renderer/partial_renderer/collection_caching.rb
@@ -51,7 +51,7 @@ module ActionView
end
def expanded_cache_key(key)
- key = @view.fragment_cache_key(@view.cache_fragment_name(key))
+ key = @view.fragment_cache_key(@view.cache_fragment_name(key, virtual_path: @template.virtual_path))
key.frozen? ? key.dup : key # #read_multi & #write may require mutability, Dalli 2.6.0.
end