module ActiveBatch::BatchedJob

Public Instance Methods

in_batch?() click to toggle source
# File lib/active_batch/batched_job.rb, line 15
def in_batch?
  work_unit_in_batch(self)
end
perform_batch(*args) click to toggle source
# File lib/active_batch/batched_job.rb, line 20
def perform_batch(*args)
  BatchSchedulerJob.perform_later(self.name, *args)
end
save_result(result) click to toggle source
# File lib/active_batch/batched_job.rb, line 11
def save_result(result)
  work_unit_in_batch(self).update!(work_result: result.to_s) if in_batch?
end
work_unit_in_batch(job) click to toggle source
# File lib/active_batch/batched_job.rb, line 7
def work_unit_in_batch(job)
  WorkUnit.find_by(job_id: job.job_id)
end