Make Sprockets::Helpers::RailsHelper#debug_assets? more readable #2690

Merged
merged 1 commit into from Aug 25, 2011
View
8 actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -58,10 +58,10 @@ def asset_path(source, default_ext = nil, body = false, protocol = nil)
private
def debug_assets?
- Rails.application.config.assets.allow_debugging &&
- (Rails.application.config.assets.debug ||
- params[:debug_assets] == '1' ||
- params[:debug_assets] == 'true')
+ config = Rails.application.config.assets
+ param = params[:debug_assets]
+
+ config.allow_debugging && (config.debug || param == '1' || param == 'true')
end
# Override to specify an alternative prefix for asset path generation.