Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/no_rails_middleware.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# When required in the application's Gemfile, this prevents the Rollbar
# middleware from being inserted into the Rails middleware stack.
#
# ex:
# `gem 'rollbar', require: ['no_rails_middleware', 'rollbar']`
#
module Rollbar
NO_RAILS_MIDDLEWARE = true
end
6 changes: 4 additions & 2 deletions lib/rollbar/plugins/rails/railtie32.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ class Railtie < ::Rails::Railtie
require 'rollbar/middleware/rails/rollbar'
require 'rollbar/middleware/rails/show_exceptions'

app.config.middleware.insert_after ActionDispatch::DebugExceptions,
Rollbar::Middleware::Rails::RollbarMiddleware
unless defined?(Rollbar::NO_RAILS_MIDDLEWARE) && Rollbar::NO_RAILS_MIDDLEWARE
app.config.middleware.insert_after ActionDispatch::DebugExceptions,
Rollbar::Middleware::Rails::RollbarMiddleware
end
ActionDispatch::DebugExceptions.send(:include,
Rollbar::Middleware::Rails::ShowExceptions)
end
Expand Down