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:
evazion
2022-01-05 11:14:56 -06:00
parent 090125e239
commit b254d6d9d9

View File

@@ -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