jobs: fix searching by name not finding certain jobs.
Fix a bug where /jobs?search[name]=Prune+Posts didn't find jobs named PrunePostsJob.
`"Prune Posts".tr(" ", "_").classify` was wrong because it returned `"PrunePost"`.
This commit is contained in:
@@ -27,7 +27,7 @@ class BackgroundJob < GoodJob::ActiveJobJob
|
||||
end
|
||||
|
||||
def name_matches(name)
|
||||
class_name = name.tr(" ", "_").classify + "Job"
|
||||
class_name = name.tr(" ", "_").gsub("/", "::").camelize + "Job"
|
||||
where_json_contains(:serialized_params, { job_class: class_name })
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user