Module: JobPacks::Callbacks

Defined in:
lib/job_packs/callbacks.rb

Instance Method Summary collapse

Instance Method Details

#before(job) ⇒ Object



9
10
11
12
13
# File 'lib/job_packs/callbacks.rb', line 9

def before(job)
  find_job_pack_item(job)
  @job_pack_item.status = JobPacks::JobPackItem::RUNNING
  @job_pack_item.save!
end

#failure(job) ⇒ Object



15
16
17
18
19
# File 'lib/job_packs/callbacks.rb', line 15

def failure(job)
  find_job_pack_item(job)
  @job_pack_item.status = JobPacks::JobPackItem::ERROR
  @job_pack_item.save!
end

#success(job) ⇒ Object



3
4
5
6
7
# File 'lib/job_packs/callbacks.rb', line 3

def success(job)
  find_job_pack_item(job)
  @job_pack_item.status = JobPacks::JobPackItem::DONE
  @job_pack_item.save!
end