From 914e2002d8bf86d1c7047f4f6280dcf7b0c8bd19 Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Fri, 12 Feb 2016 20:50:26 +0100 Subject: [PATCH] Remove single_template_render? method. Written when I didn't understand the internals as well. Action View generally just refers to `@template` when meaning a fixed template render. So follow that implicit convention. --- .../renderer/partial_renderer/collection_caching.rb | 6 +----- 1 file changed, 1 insertion(+), 5 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 19d9fdf1d4..5a294744e8 100644 --- a/actionview/lib/action_view/renderer/partial_renderer/collection_caching.rb +++ b/actionview/lib/action_view/renderer/partial_renderer/collection_caching.rb @@ -30,14 +30,10 @@ module ActionView end def automatic_cache_eligible? - single_template_render? && !callable_cache_key? && + @template && !callable_cache_key? && @template.eligible_for_collection_caching?(as: @options[:as]) end - def single_template_render? - @template # Template is only set when a collection renders one template. - end - def callable_cache_key? @options[:cache].respond_to?(:call) end