jobs: add ability to search jobs on /jobs page.
Add ability to search jobs on the /jobs page by job type or by status. Fixes #2577 (Search filters for delayed jobs). This wasn't possible before with DelayedJobs because it stored the job data in a YAML string, which made it difficult to search jobs by type. GoodJobs stores job data in a JSON object, which is easier to search in Postgres.
This commit is contained in:
16
app/policies/background_job_policy.rb
Normal file
16
app/policies/background_job_policy.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class BackgroundJobPolicy < ApplicationPolicy
|
||||
def index?
|
||||
true
|
||||
end
|
||||
|
||||
def update?
|
||||
user.is_admin?
|
||||
end
|
||||
|
||||
alias_method :cancel?, :update?
|
||||
alias_method :destroy?, :update?
|
||||
alias_method :retry?, :update?
|
||||
alias_method :run?, :update?
|
||||
end
|
||||
Reference in New Issue
Block a user