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!
This commit is contained in:
Daniel Schierbeck
2011-08-22 16:50:33 +02:00
parent aae5ebf3eb
commit db181bddb6

View File

@@ -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