instance method
before_perform
Ruby on Rails 8.0.4
Since v4.2.9Signature
before_perform(*filters, &blk)
Defines a callback that will get called right before the job’s perform method is executed.
class VideoProcessJob < ActiveJob::Base queue_as :default before_perform do |job| UserMailer.notify_video_started_processing(job.arguments.first) end def perform(video_id) Video.find(video_id).process end end
Parameters
-
filtersrest -
blkblock
Source
# File activejob/lib/active_job/callbacks.rb, line 50
def before_perform(*filters, &blk)
set_callback(:perform, :before, *filters, &blk)
end
Defined in activejob/lib/active_job/callbacks.rb line 50
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveJob::Callbacks::ClassMethods