提交 1f898981 编写于 作者: B Ben Woosley

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.
上级 410e7541
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册