Class: Airbrake::Rails::Railties::MiddlewareTie Private

Inherits:
Object
  • Object
show all
Defined in:
lib/airbrake/rails/railties/middleware_tie.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Ties Airbrake Rails Middleware with Rails (error sending).

Since Rails 3.2 the ActionDispatch::DebugExceptions middleware is responsible for logging exceptions and showing a debugging page in case the request is local. We want to insert our middleware after DebugExceptions, so we don’t notify Airbrake about local requests.

Since:

  • v13.0.1

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ MiddlewareTie

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of MiddlewareTie.

Since:

  • v13.0.1



16
17
18
19
# File 'lib/airbrake/rails/railties/middleware_tie.rb', line 16

def initialize(app)
  @app = app
  @middleware = app.config.middleware
end

Instance Method Details

#callObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • v13.0.1



21
22
23
24
25
26
27
28
29
# File 'lib/airbrake/rails/railties/middleware_tie.rb', line 21

def call
  return tie_rails_5_or_above if ::Rails.version.to_i >= 5

  if defined?(::ActiveRecord::ConnectionAdapters::ConnectionManagement)
    return tie_rails_4_or_below_with_active_record
  end

  tie_rails_4_or_below_without_active_record
end