Skip to content

Commit d1aa6af

Browse files
authored
Merge pull request rails#46194 from sampatbadhe/add-parent-option-to-active-job-guide
ActiveJob: Add parent option to Active Job guides [ci-skip]
2 parents e7483ba + 6f26282 commit d1aa6af

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

guides/source/active_job_basics.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,23 @@ end
7979

8080
Note that you can define `perform` with as many arguments as you want.
8181

82+
If you already have an abstract class and its name differs from `ApplicationJob`, you can pass
83+
the `--parent` option to indicate you want a different abstract class:
84+
85+
```bash
86+
$ bin/rails generate job process_payment --parent=payment_job
87+
```
88+
89+
```ruby
90+
class ProcessPaymentJob < PaymentJob
91+
queue_as :default
92+
93+
def perform(*args)
94+
# Do something later
95+
end
96+
end
97+
```
98+
8299
### Enqueue the Job
83100

84101
Enqueue a job using [`perform_later`][] and, optionally, [`set`][]. Like so:

0 commit comments

Comments
 (0)