1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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.
This commit is contained in:
Damien Mathieu 2011-08-23 11:02:44 +02:00
parent 7079701e5b
commit 13dd7758ce
2 changed files with 8 additions and 7 deletions

View file

@ -70,12 +70,9 @@ module Sprockets
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 file

@ -142,7 +142,11 @@ class RoutedRackApp
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|