aboutsummaryrefslogtreecommitdiffstats
path: root/activejob
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2015-03-30 23:01:16 +1030
committerMatthew Draper <matthew@trebex.net>2015-03-30 23:04:25 +1030
commitcb012467214f6e4bb1ac3987554bb75020b4796b (patch)
treea2b16c15b50bc40da24f2d8d6e03aef88557974f /activejob
parente2a96c071216d14659294a5a7645878656c30916 (diff)
parent929a794a317666e4d29954e4f071c1dd57482aa7 (diff)
downloadrails-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.md4
-rw-r--r--activejob/lib/rails/generators/job/job_generator.rb1
-rw-r--r--activejob/lib/rails/generators/job/templates/job.rb2
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)