Sha256: c2007454dad89955bf2d3a05c77d29fc7e094c7be60e41592bf6176a259e3a67

Contents?: true

Size: 669 Bytes

Versions: 2

Compression:

Stored size: 669 Bytes

Contents

# frozen_string_literal: true

require 'active_support/ordered_options'
require 'rails/railtie'

module Logjoy
  class Railtie < Rails::Railtie
    config.logjoy = ActiveSupport::OrderedOptions.new

    config.after_initialize do |app|
      Logjoy.set_customizer(app)
    end

    Logjoy::REPLACE_SUBSCRIBERS.each do |component|
      config.after_initialize do |app|
        Logjoy.detach_default_subscriber(app, component)
        Logjoy.attach_subscriber(app, component)
      end
    end

    Logjoy::DETACH_SUBSCRIBERS.each do |component|
      config.after_initialize do |app|
        Logjoy.detach_default_subscriber(app, component)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
logjoy-0.2.0 lib/logjoy/railtie.rb
logjoy-0.1.0 lib/logjoy/railtie.rb