Skip to content

Commit 1b08a81

Browse files
authored
Merge pull request rails#55370 from cglwn/cglwn/fix-guests-cleanup-job-typo
Fix typo in "Bulk Enqueuing" section guides [skip ci]
2 parents 2a4cf3a + c482fe9 commit 1b08a81

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

guides/source/active_job_basics.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -747,24 +747,24 @@ jobs as arguments (note that this is different from `perform_later`).
747747
`perform_all_later` does call `perform` under the hood. The arguments passed to
748748
`new` will be passed on to `perform` when it's eventually called.
749749

750-
Here is an example calling `perform_all_later` with `GuestCleanupJob` instances:
750+
Here is an example calling `perform_all_later` with `GuestsCleanupJob` instances:
751751

752752
```ruby
753753
# Create jobs to pass to `perform_all_later`.
754754
# The arguments to `new` are passed on to `perform`
755-
guest_cleanup_jobs = Guest.all.map { |guest| GuestsCleanupJob.new(guest) }
755+
cleanup_jobs = Guest.all.map { |guest| GuestsCleanupJob.new(guest) }
756756

757-
# Will enqueue a separate job for each instance of `GuestCleanupJob`
758-
ActiveJob.perform_all_later(guest_cleanup_jobs)
757+
# Will enqueue a separate job for each instance of `GuestsCleanupJob`
758+
ActiveJob.perform_all_later(cleanup_jobs)
759759

760760
# Can also use `set` method to configure options before bulk enqueuing jobs.
761-
guest_cleanup_jobs = Guest.all.map { |guest| GuestsCleanupJob.new(guest).set(wait: 1.day) }
761+
cleanup_jobs = Guest.all.map { |guest| GuestsCleanupJob.new(guest).set(wait: 1.day) }
762762

763-
ActiveJob.perform_all_later(guest_cleanup_jobs)
763+
ActiveJob.perform_all_later(cleanup_jobs)
764764
```
765765

766766
`perform_all_later` logs the number of jobs successfully enqueued, for example
767-
if `Guest.all.map` above resulted in 3 `guest_cleanup_jobs`, it would log
767+
if `Guest.all.map` above resulted in 3 `cleanup_jobs`, it would log
768768
`Enqueued 3 jobs to Async (3 GuestsCleanupJob)` (assuming all were enqueued).
769769

770770
The return value of `perform_all_later` is `nil`. Note that this is different

0 commit comments

Comments
 (0)