From 7dab186fded971e69f9d8bf5db524c20da326b83 Mon Sep 17 00:00:00 2001 From: Christos Trochalakis Date: Thu, 16 Sep 2010 19:44:18 +0300 Subject: Issue one Cache#read command instead of two in the case of a fragment cache hit --- actionpack/lib/action_view/helpers/cache_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_view') diff --git a/actionpack/lib/action_view/helpers/cache_helper.rb b/actionpack/lib/action_view/helpers/cache_helper.rb index 30e6c078b1..385378ea29 100644 --- a/actionpack/lib/action_view/helpers/cache_helper.rb +++ b/actionpack/lib/action_view/helpers/cache_helper.rb @@ -44,8 +44,8 @@ module ActionView private # TODO: Create an object that has caching read/write on it def fragment_for(name = {}, options = nil, &block) #:nodoc: - if controller.fragment_exist?(name, options) - controller.read_fragment(name, options) + if fragment = controller.read_fragment(name, options) + fragment else # VIEW TODO: Make #capture usable outside of ERB # This dance is needed because Builder can't use capture -- cgit v1.2.3