Sha256: 12fea2dce143e81e82b863e77467bc7b4430c3e1f5cc12c5096eab94d7d96e3a

Contents?: true

Size: 520 Bytes

Versions: 46

Compression:

Stored size: 520 Bytes

Contents

module Sidekiq
  def self.hook_rails!
    if defined?(::ActiveRecord)
      ::ActiveRecord::Base.send(:include, Sidekiq::Extensions::ActiveRecord)
    end

    if defined?(::ActionMailer)
      ::ActionMailer::Base.extend(Sidekiq::Extensions::ActionMailer)
    end
  end

  class Rails < ::Rails::Engine
    config.autoload_paths << File.expand_path("#{config.root}/app/workers") if File.exist?("#{config.root}/app/workers")

    initializer 'sidekiq' do
      Sidekiq.hook_rails!
    end
  end if defined?(::Rails)
end

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
sidekiq-2.17.4 lib/sidekiq/rails.rb
sidekiq-2.17.3 lib/sidekiq/rails.rb
sidekiq-2.17.2 lib/sidekiq/rails.rb
sidekiq-2.17.1 lib/sidekiq/rails.rb
sidekiq-2.17.0 lib/sidekiq/rails.rb
sidekiq-2.16.1 lib/sidekiq/rails.rb
sidekiq-2.16.0 lib/sidekiq/rails.rb
sidekiq-2.15.2 lib/sidekiq/rails.rb
sidekiq-2.15.1 lib/sidekiq/rails.rb
sidekiq-2.15.0 lib/sidekiq/rails.rb
sidekiq-2.14.1 lib/sidekiq/rails.rb
sidekiq-2.14.0 lib/sidekiq/rails.rb
sidekiq-2.13.1 lib/sidekiq/rails.rb
sidekiq-2.13.0 lib/sidekiq/rails.rb
sidekiq-2.12.4 lib/sidekiq/rails.rb
sidekiq-2.12.3 lib/sidekiq/rails.rb
sidekiq-2.12.1 lib/sidekiq/rails.rb
sidekiq-2.12.0 lib/sidekiq/rails.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/sidekiq-2.11.2/lib/sidekiq/rails.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/sidekiq-2.11.2/lib/sidekiq/rails.rb