Skip to content

Commit

Permalink
Make sure that we set env["action_dispatch.show_exceptions"]
Browse files Browse the repository at this point in the history
This has been used by `show_exception` middleware even the setting wasn't get passed to `env` hash.
  • Loading branch information
sikachu authored and tenderlove committed Feb 25, 2011
1 parent 13547c1 commit 439a745
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion railties/lib/rails/application.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ def env_config
@env_config ||= super.merge({ @env_config ||= super.merge({
"action_dispatch.parameter_filter" => config.filter_parameters, "action_dispatch.parameter_filter" => config.filter_parameters,
"action_dispatch.secret_token" => config.secret_token, "action_dispatch.secret_token" => config.secret_token,
"action_dispatch.asset_path" => nil "action_dispatch.asset_path" => nil,
"action_dispatch.show_exceptions" => config.action_dispatch.show_exceptions
}) })
end end


Expand Down
15 changes: 15 additions & 0 deletions railties/test/application/configuration_test.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -318,5 +318,20 @@ def index


assert ActionView::Resolver.caching? assert ActionView::Resolver.caching?
end end

test "config.action_dispatch.show_exceptions is sent in env" do
make_basic_app do |app|
app.config.action_dispatch.show_exceptions = true
end

class ::OmgController < ActionController::Base
def index
render :text => env["action_dispatch.show_exceptions"]
end
end

get "/"
assert_equal 'true', last_response.body
end
end end
end end

0 comments on commit 439a745

Please sign in to comment.