Skip to content

Commit

Permalink
Refactor Sprockets::Helpers::RailsHelper#performing_caching?
Browse files Browse the repository at this point in the history
No need for them lines to get so long! Also, move that comment into
the method body where it belongs!
  • Loading branch information
dasch committed Aug 22, 2011
1 parent aae5ebf commit db181bd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions actionpack/lib/sprockets/helpers/rails_helper.rb
Expand Up @@ -139,9 +139,14 @@ def rewrite_extension(source, dir, ext)
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
Expand Down

0 comments on commit db181bd

Please sign in to comment.