diff options
Diffstat (limited to 'activejob/lib/active_job/railtie.rb')
-rw-r--r-- | activejob/lib/active_job/railtie.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/activejob/lib/active_job/railtie.rb b/activejob/lib/active_job/railtie.rb index b249ec09dd..e4198a40a5 100644 --- a/activejob/lib/active_job/railtie.rb +++ b/activejob/lib/active_job/railtie.rb @@ -1,12 +1,12 @@ -require 'global_id/railtie' -require 'active_job' +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 + initializer "active_job.logger" do ActiveSupport.on_load(:active_job) { self.logger = ::Rails.logger } end @@ -19,5 +19,14 @@ module ActiveJob 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 |