Module: DelayedJobsHelper

Defined in:
app/helpers/delayed_jobs_helper.rb

Instance Method Summary collapse

Instance Method Details

#job_status(job) ⇒ Object



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

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



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

def job_type(job)
  case job.name
  when /StudyReport/
    'generate study report'
  when /Submission/
    'process submission '
  else
    job.name
  end
end