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

Simple fix to the NoMethodError noted in #2177.

Unfortunately #respond_to?(:controller) won't work as suggested, nor will respond_to?(:params), as #controller is present and #params is delegated to #controller. #delegate makes respond_to? return true regardless whether the target responds to it.
This commit is contained in:
Ben Woosley 2011-07-23 17:31:48 -07:00
parent 410e75419d
commit 1f89898175
2 changed files with 2 additions and 1 deletions

View file

@ -72,6 +72,8 @@ module Sprockets
def debug_assets?
params[:debug_assets] == '1' ||
params[:debug_assets] == 'true'
rescue NoMethodError
false
end
# Override to specify an alternative prefix for asset path generation.

View file

@ -12,7 +12,6 @@ class SprocketsHelperTest < ActionView::TestCase
super
@controller = BasicController.new
@controller.stubs(:params).returns({})
@request = Class.new do
def protocol() 'http://' end