Module: DelayedJobsHelper

Defined in:
app/helpers/delayed_jobs_helper.rb

Instance Method Summary collapse

Instance Method Details

#job_status(job) ⇒ Object


12
13
14
15
16
17
18
19
20
21
22
# File 'app/helpers/delayed_jobs_helper.rb', line 12

def job_status(job)
  if job.locked_by
    'In progress'
  elsif job.failed?
    'Failed'
  elsif job.last_error?
    'error'
  else
    'pending'
  end
end

#job_type(job) ⇒ Object


2
3
4
5
6
7
8
9
10
# File 'app/helpers/delayed_jobs_helper.rb', line 2

def job_type(job)
  if job.name.match?(/StudyReport/)
    'generate study report'
  elsif job.name.match?(/Submission/)
    'process submission '
  else
    job.name
  end
end