Sha256: 6f668297c0cc05291e6f216700cb576aa4d9d0fe2796e90bc44332d03c0c7dfa

Contents?: true

Size: 987 Bytes

Versions: 1

Compression:

Stored size: 987 Bytes

Contents

# frozen_string_literal: true

module Bugscriber
  module Subscribers
    extend ActiveSupport::Concern

    AVAILABLE_SUBSCRIPTIONS = %w[
      action_controller
      action_dispatch
      action_view
      active_record
      action_mailer
      active_support
      active_job
      action_cable
      active_storage
      railties
      rails
    ].freeze

    included do
      AVAILABLE_SUBSCRIPTIONS.each do |subscription_method|
        ActiveSupport::Notifications.subscribe(/#{subscription_method}/) do |name, started, finished, unique_id, data|
          Bugscriber::Helpers.create_track(type: subscription_method,
                                           method: name,
                                           started_at: started,
                                           finished_at: finished,
                                           external_process_id: unique_id,
                                           payload: data)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bugscriber-0.1.0 lib/bugscriber/subscribers.rb