Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rails/web-console
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 58bc8f6a94e165527c9fdc223cd648f73f84d7b9
Choose a base ref
..
head repository: rails/web-console
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 005285c7ed2875761454da945abff810758ac5a3
Choose a head ref
Showing with 15 additions and 0 deletions.
  1. +6 −0 lib/web_console/engine.rb
  2. +9 −0 test/web_console/engine_test.rb
6 changes: 6 additions & 0 deletions lib/web_console/engine.rb
Original file line number Diff line number Diff line change
@@ -47,5 +47,11 @@ def render_exception_with_web_console(env, exception)
Request.whitelisted_ips = Whitelist.new(whitelisted_ips)
end
end

initializer 'web_console.whiny_requests' do
if config.web_console.key?(:whiny_requests)
Middleware.whiny_requests = config.web_console.whiny_requests
end
end
end
end
9 changes: 9 additions & 0 deletions test/web_console/engine_test.rb
Original file line number Diff line number Diff line change
@@ -36,6 +36,15 @@ class EngineTest < ActiveSupport::TestCase
end
end

test 'config.whiny_request removes extra logging' do
new_uninitialized_app do |app|
app.config.web_console.whiny_requests = false
app.initialize!

assert_not Middleware.whiny_requests
end
end

private

def new_uninitialized_app(root = File.expand_path('../../dummy', __FILE__))