From db181bddb646ff22c85218072ba5c69ca680dabd Mon Sep 17 00:00:00 2001 From: Daniel Schierbeck Date: Mon, 22 Aug 2011 16:50:33 +0200 Subject: Refactor Sprockets::Helpers::RailsHelper#performing_caching? No need for them lines to get so long! Also, move that comment into the method body where it belongs! --- actionpack/lib/sprockets/helpers/rails_helper.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb index 69306ef631..cb01532449 100644 --- a/actionpack/lib/sprockets/helpers/rails_helper.rb +++ b/actionpack/lib/sprockets/helpers/rails_helper.rb @@ -139,9 +139,14 @@ module Sprockets end end - # When included in Sprockets::Context, we need to ask the top-level config as the controller is not available def performing_caching? - config.action_controller.present? ? config.action_controller.perform_caching : config.perform_caching + # When included in Sprockets::Context, we need to ask the + # top-level config as the controller is not available. + if config.action_controller.present? + config.action_controller.perform_caching + else + config.perform_caching + end end end end -- cgit v1.2.3