2014-08-17 19:17:38 -04:00
|
|
|
require 'global_id/railtie'
|
2014-08-12 06:53:46 -04:00
|
|
|
require 'active_job'
|
2014-05-21 16:45:56 -04:00
|
|
|
|
|
|
|
module ActiveJob
|
|
|
|
# = Active Job Railtie
|
|
|
|
class Railtie < Rails::Railtie # :nodoc:
|
2014-08-15 16:32:08 -04:00
|
|
|
config.active_job = ActiveSupport::OrderedOptions.new
|
|
|
|
|
|
|
|
initializer 'active_job.logger' do
|
2014-05-21 17:10:17 -04:00
|
|
|
ActiveSupport.on_load(:active_job) { self.logger = ::Rails.logger }
|
2014-05-21 16:45:56 -04:00
|
|
|
end
|
2014-08-15 16:32:08 -04:00
|
|
|
|
|
|
|
initializer "active_job.set_configs" do |app|
|
|
|
|
options = app.config.active_job
|
|
|
|
options.queue_adapter ||= :inline
|
|
|
|
|
|
|
|
ActiveSupport.on_load(:active_job) do
|
|
|
|
options.each { |k,v| send("#{k}=", v) }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-05-21 16:45:56 -04:00
|
|
|
end
|
2014-08-12 06:53:46 -04:00
|
|
|
end
|