Sha256: c9c8e713f3663775e5415e1e12254761322cc445d50378ad6213417c8e54e11f
Contents?: true
Size: 526 Bytes
Versions: 5
Compression:
Stored size: 526 Bytes
Contents
module IntegrationPal class Job < ApplicationRecord include IntegrationPal::Statusable store :job_params, coder: Hash belongs_to :worker has_many :tasks validates :worker, presence: true def queue_job raise 'Cannot start a non persisted job' unless self.persisted? worker.job_class.perform_later(self.id) end def start self.update_attributes(status: IN_PROGRESS_STATUS, started_at: Time.zone.now, job_params: self.job_params.merge(worker.settings)) end end end
Version data entries
5 entries across 5 versions & 1 rubygems