1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add more detailed description to job generator

This commit is contained in:
Gannon McGibbon 2022-06-10 17:45:22 -05:00
parent 7c1165c8c8
commit 5f57c7d352
3 changed files with 19 additions and 2 deletions

View file

@ -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.

View file

@ -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.

View file

@ -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"