lib/honeybadger/init/rails.rb in honeybadger-2.2.0 vs lib/honeybadger/init/rails.rb in honeybadger-2.3.0
- old
+ new
@@ -1,9 +1,13 @@
require 'rails'
require 'yaml'
+
require 'honeybadger/util/sanitizer'
require 'honeybadger/util/request_payload'
+require 'honeybadger/rack/error_notifier'
+require 'honeybadger/rack/user_informer'
+require 'honeybadger/rack/user_feedback'
module Honeybadger
module Init
module Rails
class Railtie < ::Rails::Railtie
@@ -14,12 +18,12 @@
initializer 'honeybadger.install' do
config = Config.new(local_config)
if Honeybadger.start(config)
if config.feature?(:notices) && config[:'exceptions.enabled']
::Rails.application.config.middleware.tap do |middleware|
- middleware.insert(0, 'Honeybadger::Rack::ErrorNotifier', config)
- middleware.insert_before('Honeybadger::Rack::ErrorNotifier', 'Honeybadger::Rack::UserInformer', config) if config[:'user_informer.enabled']
- middleware.insert_before('Honeybadger::Rack::ErrorNotifier', 'Honeybadger::Rack::UserFeedback', config) if config[:'feedback.enabled']
+ middleware.insert(0, Honeybadger::Rack::ErrorNotifier, config)
+ middleware.insert_before(Honeybadger::Rack::ErrorNotifier, Honeybadger::Rack::UserInformer, config) if config[:'user_informer.enabled']
+ middleware.insert_before(Honeybadger::Rack::ErrorNotifier, Honeybadger::Rack::UserFeedback, config) if config[:'feedback.enabled']
end
end
if config.feature?(:traces) && config[:'traces.enabled']
ActiveSupport::Notifications.subscribe('start_processing.action_controller') do |name, started, finished, id, data|