diff options
author | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2015-02-22 21:52:58 +0100 |
---|---|---|
committer | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2015-03-23 22:37:11 +0100 |
commit | 929a794a317666e4d29954e4f071c1dd57482aa7 (patch) | |
tree | 44804aa0548b42c7942b5613826cd4a1c05d7444 /activejob | |
parent | b6c038b600487b1adcf8f5e69ba70a992b07e195 (diff) | |
download | rails-929a794a317666e4d29954e4f071c1dd57482aa7.tar.gz rails-929a794a317666e4d29954e4f071c1dd57482aa7.tar.bz2 rails-929a794a317666e4d29954e4f071c1dd57482aa7.zip |
Add explicit base class for ActiveJob jobs
* Jobs generated now inherent from ApplicationJob
* ApplicationJob inherents from ActiveJob::Base
* Added entry to changelog
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Diffstat (limited to 'activejob')
-rw-r--r-- | activejob/CHANGELOG.md | 4 | ||||
-rw-r--r-- | activejob/lib/rails/generators/job/job_generator.rb | 1 | ||||
-rw-r--r-- | activejob/lib/rails/generators/job/templates/job.rb | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/activejob/CHANGELOG.md b/activejob/CHANGELOG.md index d4e19274fa..47975b2f2f 100644 --- a/activejob/CHANGELOG.md +++ b/activejob/CHANGELOG.md @@ -77,4 +77,8 @@ *Isaac Seymour* +* A generated job now inherents from `app/job/application_job.rb` by default. + + *Jeroen van Baarsen* + Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/activejob/CHANGELOG.md) for previous changes. diff --git a/activejob/lib/rails/generators/job/job_generator.rb b/activejob/lib/rails/generators/job/job_generator.rb index 979ffcb748..86e4c5266c 100644 --- a/activejob/lib/rails/generators/job/job_generator.rb +++ b/activejob/lib/rails/generators/job/job_generator.rb @@ -18,7 +18,6 @@ module Rails def create_job_file template 'job.rb', File.join('app/jobs', class_path, "#{file_name}_job.rb") end - end end end diff --git a/activejob/lib/rails/generators/job/templates/job.rb b/activejob/lib/rails/generators/job/templates/job.rb index 462c71d917..4ad2914a45 100644 --- a/activejob/lib/rails/generators/job/templates/job.rb +++ b/activejob/lib/rails/generators/job/templates/job.rb @@ -1,5 +1,5 @@ <% module_namespacing do -%> -class <%= class_name %>Job < ActiveJob::Base +class <%= class_name %>Job < ApplicationJob queue_as :<%= options[:queue] %> def perform(*args) |