diff options
author | Christopher Baines <mail@cbaines.net> | 2018-06-22 07:37:21 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2018-06-22 07:37:21 +0100 |
commit | 4fbb412eaba21274919293f0b288c41da38c99a1 (patch) | |
tree | f280f0eaaea08e98925a3b0fe70a853688df8e25 | |
parent | 1fcb11bb31d0ffbf37de3ce704231bdcdaf787ca (diff) | |
download | govuk-mini-environment-admin-4fbb412eaba21274919293f0b288c41da38c99a1.tar govuk-mini-environment-admin-4fbb412eaba21274919293f0b288c41da38c99a1.tar.gz |
Give the jobs more descriptive titles on the show page
-rw-r--r-- | app/jobs/mini_environment_job.rb | 4 | ||||
-rw-r--r-- | app/views/shared/_jobs.html.erb | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/app/jobs/mini_environment_job.rb b/app/jobs/mini_environment_job.rb index e5112cd..1e41954 100644 --- a/app/jobs/mini_environment_job.rb +++ b/app/jobs/mini_environment_job.rb @@ -29,6 +29,10 @@ class MiniEnvironmentJob < Que::Job end end + def self.job_title(que_job) + que_job.args.last.titleize + end + def self.jobs(mini_environment_id) QueJob .where( diff --git a/app/views/shared/_jobs.html.erb b/app/views/shared/_jobs.html.erb index 417f8a0..d4c74b6 100644 --- a/app/views/shared/_jobs.html.erb +++ b/app/views/shared/_jobs.html.erb @@ -19,7 +19,7 @@ aria-expanded="true" aria-controls="job_<%= job.id %>" > - <%= job.job_class %> + <%= job.job_class.constantize.try(:job_title, job) || job.job_class %> <span class="caret"></span> </a> <span class="pull-right"> |