aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@github.com>2019-02-19 13:45:30 -0800
committerGitHub <noreply@github.com>2019-02-19 13:45:30 -0800
commitff6b713f5e729859995f204093ad3f8e08f39ea8 (patch)
tree2729530ac520a01230e9a632fde5d549e140a5e7 /actionview/lib/action_view/helpers
parent16a8072e2db29d5ec895830dca995f99ce1915d6 (diff)
parentdf12a1b2413906ee38a977e3cbb325512c184837 (diff)
downloadrails-ff6b713f5e729859995f204093ad3f8e08f39ea8.tar.gz
rails-ff6b713f5e729859995f204093ad3f8e08f39ea8.tar.bz2
rails-ff6b713f5e729859995f204093ad3f8e08f39ea8.zip
Merge pull request #35293 from rails/remove-rendered-format-from-cache
Pass the template format to the digestor
Diffstat (limited to 'actionview/lib/action_view/helpers')
-rw-r--r--actionview/lib/action_view/helpers/cache_helper.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/actionview/lib/action_view/helpers/cache_helper.rb b/actionview/lib/action_view/helpers/cache_helper.rb
index b1a14250c3..6b69b71947 100644
--- a/actionview/lib/action_view/helpers/cache_helper.rb
+++ b/actionview/lib/action_view/helpers/cache_helper.rb
@@ -216,13 +216,13 @@ module ActionView
end
end
- def digest_path_from_virtual(virtual_path) # :nodoc:
- digest = Digestor.digest(name: virtual_path, finder: lookup_context, dependencies: view_cache_dependencies)
+ def digest_path_from_template(template) # :nodoc:
+ digest = Digestor.digest(name: template.virtual_path, format: template.formats.first, finder: lookup_context, dependencies: view_cache_dependencies)
if digest.present?
- "#{virtual_path}:#{digest}"
+ "#{template.virtual_path}:#{digest}"
else
- virtual_path
+ template.virtual_path
end
end
@@ -234,7 +234,7 @@ module ActionView
if virtual_path || digest_path
name = controller.url_for(name).split("://").last if name.is_a?(Hash)
- digest_path ||= digest_path_from_virtual(virtual_path)
+ digest_path ||= digest_path_from_template(@current_template)
[ digest_path, name ]
else