diff --git a/app/models/background_job.rb b/app/models/background_job.rb index 3639ccb97..9add90af5 100644 --- a/app/models/background_job.rb +++ b/app/models/background_job.rb @@ -5,6 +5,8 @@ # # @see https://github.com/bensheldon/good_job/blob/main/lib/good_job/active_job_job.rb class BackgroundJob < GoodJob::ActiveJobJob + delegate :executions_count, to: :job + concerning :SearchMethods do class_methods do def default_order @@ -58,5 +60,9 @@ class BackgroundJob < GoodJob::ActiveJobJob end end end + + def pretty_name + job.job_class.titleize.delete_suffix(" Job") + end end end diff --git a/app/views/jobs/index.html.erb b/app/views/jobs/index.html.erb index ba6bfafc8..c38655b84 100644 --- a/app/views/jobs/index.html.erb +++ b/app/views/jobs/index.html.erb @@ -11,7 +11,7 @@ <%= table_for @jobs, class: "striped autofit" do |t| %> <% t.column "Name" do |job| %> - <%= job.job_class.titleize.delete_suffix(" Job") %> + <%= job.pretty_name %> <% end %> <% t.column "Details", td: { class: "col-expand" } do |job| %>