Sha256: b47d30992f2f8843d269511dadf89464d922b5ea099b16b1adc125530ffdc908

Contents?: true

Size: 744 Bytes

Versions: 4

Compression:

Stored size: 744 Bytes

Contents

# frozen_string_literal: true

module AppMap
  # Railtie connects the AppMap recorder to Rails-specific features.
  class Railtie < ::Rails::Railtie
    # appmap.subscribe subscribes to ActiveSupport Notifications so that they can be recorded as
    # AppMap events.
    initializer 'appmap.subscribe' do |_| # params: app
      require 'appmap/handler/rails/sql_handler'
      require 'appmap/handler/rails/request_handler'
      ActiveSupport::Notifications.subscribe 'sql.sequel', AppMap::Handler::Rails::SQLHandler.new
      ActiveSupport::Notifications.subscribe 'sql.active_record', AppMap::Handler::Rails::SQLHandler.new

      AppMap::Handler::Rails::RequestHandler::HookMethod.new.activate
    end
  end
end if ENV['APPMAP'] == 'true'

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
appmap-0.49.0 lib/appmap/railtie.rb
appmap-0.48.2 lib/appmap/railtie.rb
appmap-0.48.1 lib/appmap/railtie.rb
appmap-0.48.0 lib/appmap/railtie.rb