Sha256: 468c1d710810b7cd66d8499019a6d8fa091b7367a8f6827701a760b0a11fc247

Contents?: true

Size: 703 Bytes

Versions: 6

Compression:

Stored size: 703 Bytes

Contents

module Appsignal
  class Railtie < Rails::Railtie
    initializer "appsignal.configure_rails_initialization" do |app|
      if Appsignal.active?
        app.middleware.insert_before ActionDispatch::RemoteIp, Appsignal::Middleware

        Appsignal.subscriber = ActiveSupport::Notifications.subscribe(/^[^!]/) do |*args|
          if Appsignal::Transaction.current
            event = ActiveSupport::Notifications::Event.new(*args)
            if event.name == 'process_action.action_controller'
              Appsignal::Transaction.current.set_process_action_event(event)
            end
            Appsignal::Transaction.current.add_event(event)
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
appsignal-0.4.7 lib/appsignal/railtie.rb
appsignal-0.4.6 lib/appsignal/railtie.rb
appsignal-0.4.5 lib/appsignal/railtie.rb
appsignal-0.4.4 lib/appsignal/railtie.rb
appsignal-0.4.3 lib/appsignal/railtie.rb
appsignal-0.4.0 lib/appsignal/railtie.rb