Merge pull request #2631 from dasch/refactor-sprockets

Refactor Sprockets::Helpers::RailsHelper#performing_caching?
This commit is contained in:
Santiago Pastorino
2011-08-22 08:11:35 -07:00

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