diff --git a/activejob/CHANGELOG.md b/activejob/CHANGELOG.md index 7e60a5bafc..f025c9da9c 100644 --- a/activejob/CHANGELOG.md +++ b/activejob/CHANGELOG.md @@ -1,3 +1,7 @@ +* Add more detailed description to job generator. + + *Gannon McGibbon* + * `perform.active_job` notification payloads now include `:db_runtime`, which is the total time (in ms) taken by database queries while performing a job. This value can be used to better understand how a job's time is spent. diff --git a/activejob/lib/rails/generators/job/USAGE b/activejob/lib/rails/generators/job/USAGE new file mode 100644 index 0000000000..483d3aa7e7 --- /dev/null +++ b/activejob/lib/rails/generators/job/USAGE @@ -0,0 +1,15 @@ +Description: + Generates a new job. Pass the job name, either CamelCased or + under_scored, with or without the job postfix. + +Examples: + `bin/rails generate job checkout` + + Creates the the following files: + + Job: app/jobs/checkout_job.rb + Test: test/jobs/checkout_job_test.rb + + `bin/rails generate job send_sms --queue=sms` + + Creates a job and test with a custom sms queue. diff --git a/activejob/lib/rails/generators/job/job_generator.rb b/activejob/lib/rails/generators/job/job_generator.rb index 03346a7f12..d2a22a2595 100644 --- a/activejob/lib/rails/generators/job/job_generator.rb +++ b/activejob/lib/rails/generators/job/job_generator.rb @@ -5,8 +5,6 @@ require "rails/generators/named_base" module Rails # :nodoc: module Generators # :nodoc: class JobGenerator < Rails::Generators::NamedBase # :nodoc: - desc "This generator creates an active job file at app/jobs" - class_option :queue, type: :string, default: "default", desc: "The queue name for the generated job" check_class_collision suffix: "Job"