Permalink
Browse files

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.
  • Loading branch information...
1 parent 410e754 commit 1f898981751906e14a5dd3cd6dae68f97dd60a24 @Empact Empact committed Jul 24, 2011
@@ -72,6 +72,8 @@ def asset_path(source, default_ext = nil, body = false, protocol = nil)
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.
@@ -12,7 +12,6 @@ def setup
super
@controller = BasicController.new
- @controller.stubs(:params).returns({})
@request = Class.new do
def protocol() 'http://' end

0 comments on commit 1f89898

Please sign in to comment.