aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorChristos Trochalakis <yatiohi@ideopolis.gr>2010-09-16 19:44:18 +0300
committerAaron Patterson <aaron.patterson@gmail.com>2011-01-18 09:52:11 -0800
commit7dab186fded971e69f9d8bf5db524c20da326b83 (patch)
tree4d28f7fa1e1ab8f86614d056baa0c53bf726ec9f /actionpack/lib/action_view
parent11fe2161ce8adc39aa69178211f7b661eafb201a (diff)
downloadrails-7dab186fded971e69f9d8bf5db524c20da326b83.tar.gz
rails-7dab186fded971e69f9d8bf5db524c20da326b83.tar.bz2
rails-7dab186fded971e69f9d8bf5db524c20da326b83.zip
Issue one Cache#read command instead of two in the case of a fragment cache hit
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/helpers/cache_helper.rb4
1 files changed, 2 insertions, 2 deletions
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