Skip to content
Browse files

remove useless rescue

params is a method, defined in every controller, which always returns a hash.
If it raises a NoMethodError, it means there's a bug somewhere else, which we want to know about.
  • Loading branch information...
1 parent 7079701 commit 13dd7758cedf6152835c4c72b69b1fe631a60733 @dmathieu dmathieu committed Aug 23, 2011
Showing with 8 additions and 7 deletions.
  1. +3 −6 actionpack/lib/sprockets/helpers/rails_helper.rb
  2. +5 −1 actionpack/test/abstract_unit.rb
View
9 actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -70,12 +70,9 @@ def asset_path(source, default_ext = nil, body = false, protocol = nil)
private
def debug_assets?
- begin
- params[:debug_assets] == '1' ||
- params[:debug_assets] == 'true'
- rescue NoMethodError
- false
- end || Rails.application.config.assets.debug
+ params[:debug_assets] == '1' ||
+ params[:debug_assets] == 'true' ||
+ Rails.application.config.assets.debug
end
# Override to specify an alternative prefix for asset path generation.
View
6 actionpack/test/abstract_unit.rb
@@ -142,7 +142,11 @@ def call(env)
end
class BasicController
- attr_accessor :request
+ attr_accessor :request, :params
+
+ def initialize
+ @params = {}
+ end
def config
@config ||= ActiveSupport::InheritableOptions.new(ActionController::Base.config).tap do |config|

0 comments on commit 13dd775

Please sign in to comment.
Something went wrong with that request. Please try again.