diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-22 10:55:02 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-22 10:55:02 -0300 |
commit | 5722ca7ec8f4e2cec54d5360e9975c58efe21f7d (patch) | |
tree | b49c97ddb135eea5033c50b66e9b8a4b33ce294a | |
parent | 61deda528c99b28d0cf5be71641ae7a044d1b43b (diff) | |
parent | af117de37a5183e53f9c23dc9d4743e007a098d0 (diff) | |
download | rails-5722ca7ec8f4e2cec54d5360e9975c58efe21f7d.tar.gz rails-5722ca7ec8f4e2cec54d5360e9975c58efe21f7d.tar.bz2 rails-5722ca7ec8f4e2cec54d5360e9975c58efe21f7d.zip |
Merge pull request #57 from seuros/railtie
Active Job Railtie
-rw-r--r-- | lib/active_job.rb | 1 | ||||
-rw-r--r-- | lib/active_job/base.rb | 2 | ||||
-rw-r--r-- | lib/active_job/railtie.rb | 10 |
3 files changed, 13 insertions, 0 deletions
diff --git a/lib/active_job.rb b/lib/active_job.rb index ba18cc093a..ddfdda4fb4 100644 --- a/lib/active_job.rb +++ b/lib/active_job.rb @@ -24,6 +24,7 @@ require 'active_support' require 'active_support/rails' +require 'active_job/railtie' if defined?(Rails) require 'active_job/version' module ActiveJob diff --git a/lib/active_job/base.rb b/lib/active_job/base.rb index 8bddfde09f..e6b02708a1 100644 --- a/lib/active_job/base.rb +++ b/lib/active_job/base.rb @@ -11,5 +11,7 @@ module ActiveJob extend Enqueuing include Performing extend Logging + + ActiveSupport.run_load_hooks(:active_job, self) end end diff --git a/lib/active_job/railtie.rb b/lib/active_job/railtie.rb new file mode 100644 index 0000000000..08555d1d77 --- /dev/null +++ b/lib/active_job/railtie.rb @@ -0,0 +1,10 @@ +require 'active_model/railtie' + +module ActiveJob + # = Active Job Railtie + class Railtie < Rails::Railtie # :nodoc: + initializer 'active_job' do + ActiveSupport.on_load(:active_job) { self.logger = ::Rails.logger } + end + end +end
\ No newline at end of file |