Skip to content

Commit

Permalink
ActiveJob: Add parent option to Active Job guides [ci-skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
sampatbadhe committed Oct 16, 2022
1 parent e150024 commit 6f26282
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions guides/source/active_job_basics.md
Expand Up @@ -79,6 +79,23 @@ end

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

If you already have an abstract class and its name differs from `ApplicationJob`, you can pass
the `--parent` option to indicate you want a different abstract class:

```bash
$ bin/rails generate job process_payment --parent=payment_job
```

```ruby
class ProcessPaymentJob < PaymentJob
queue_as :default

def perform(*args)
# Do something later
end
end
```

### Enqueue the Job

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

0 comments on commit 6f26282

Please sign in to comment.