rails-jobs
Installation
SKILL.md
Rails Jobs
Job Configuration
- All jobs inherit from
ApplicationJob - Define
queue_asat the top of the class; use:default,:low, or:critical - Use Solid Queue in production (the Rails 8 default DB-backed runner; uses
FOR UPDATE SKIP LOCKED) - Prefer
perform_lateroverperform_nowfor background execution - For bulk enqueue, use
ActiveJob.perform_all_later(job1, job2, ...)— single round-trip, no per-job callbacks - For long-running, restart-safe work, use
ActiveJob::Continuablewith namedstepblocks (Rails 8.1+)
Transactional Enqueue
- Active Job defers enqueue until after the surrounding transaction commits (default since 7.2) — do not wrap
perform_laterinafter_commitcallbacks - The per-job
enqueue_after_transaction_commitoverride is deprecated in 8.0; rely on the default - For ad-hoc post-commit work, use
transaction do |t| t.after_commit { ... } endorActiveRecord.after_all_transactions_commit { ... }