Sha256: 7a44cee5cd457fe182b4a11c3090d3cdb67bcc3a431205710dea8ec8b8827968

Contents?: true

Size: 870 Bytes

Versions: 20

Compression:

Stored size: 870 Bytes

Contents

require "global_id/railtie"
require "active_job"

module ActiveJob
  # = Active Job Railtie
  class Railtie < Rails::Railtie # :nodoc:
    config.active_job = ActiveSupport::OrderedOptions.new

    initializer "active_job.logger" do
      ActiveSupport.on_load(:active_job) { self.logger = ::Rails.logger }
    end

    initializer "active_job.set_configs" do |app|
      options = app.config.active_job
      options.queue_adapter ||= :async

      ActiveSupport.on_load(:active_job) do
        options.each { |k, v| send("#{k}=", v) }
      end
    end

    initializer "active_job.set_reloader_hook" do |app|
      ActiveSupport.on_load(:active_job) do
        ActiveJob::Callbacks.singleton_class.set_callback(:execute, :around, prepend: true) do |_, inner|
          app.reloader.wrap do
            inner.call
          end
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
activejob-5.1.7 lib/active_job/railtie.rb
activejob-5.1.7.rc1 lib/active_job/railtie.rb
activejob-5.1.6.2 lib/active_job/railtie.rb
activejob-5.1.6.1 lib/active_job/railtie.rb
activejob-5.1.6 lib/active_job/railtie.rb
activejob-5.1.5 lib/active_job/railtie.rb
activejob-5.1.5.rc1 lib/active_job/railtie.rb
activejob-5.1.4 lib/active_job/railtie.rb
activejob-5.1.4.rc1 lib/active_job/railtie.rb
activejob-5.1.3 lib/active_job/railtie.rb
activejob-5.1.3.rc3 lib/active_job/railtie.rb
activejob-5.1.3.rc2 lib/active_job/railtie.rb
activejob-5.1.3.rc1 lib/active_job/railtie.rb
activejob-5.1.2 lib/active_job/railtie.rb
activejob-5.1.2.rc1 lib/active_job/railtie.rb
activejob-5.1.1 lib/active_job/railtie.rb
activejob-5.1.0 lib/active_job/railtie.rb
activejob-5.1.0.rc2 lib/active_job/railtie.rb
activejob-5.1.0.rc1 lib/active_job/railtie.rb
activejob-5.1.0.beta1 lib/active_job/railtie.rb