diff options
author | Matthew Draper <matthew@trebex.net> | 2015-03-30 23:01:16 +1030 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2015-03-30 23:04:25 +1030 |
commit | cb012467214f6e4bb1ac3987554bb75020b4796b (patch) | |
tree | a2b16c15b50bc40da24f2d8d6e03aef88557974f /activejob | |
parent | e2a96c071216d14659294a5a7645878656c30916 (diff) | |
parent | 929a794a317666e4d29954e4f071c1dd57482aa7 (diff) | |
download | rails-cb012467214f6e4bb1ac3987554bb75020b4796b.tar.gz rails-cb012467214f6e4bb1ac3987554bb75020b4796b.tar.bz2 rails-cb012467214f6e4bb1ac3987554bb75020b4796b.zip |
Merge pull request #19034 from jvanbaarsen/explicit-job-base-class
Add explicit base class for ActiveJob jobs
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..85a437a1dd 100644 --- a/activejob/CHANGELOG.md +++ b/activejob/CHANGELOG.md @@ -1,3 +1,7 @@ +* A generated job now inherents from `app/jobs/application_job.rb` by default. + + *Jeroen van Baarsen* + * Add an `:only` option to `perform_enqueued_jobs` to filter jobs based on type. 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) |