good_job
good_job copied to clipboard
Pundit::NotDefinedError (unable to find policy `Admin::GoodJob::JobPolicy` for ) - version 2.13.0 and above
I got this error when upgrading from 2.11.3 to 2.13.0(and above), full log:
undit::NotDefinedError (unable to find policy `Admin::GoodJob::JobPolicy` for `[:admin, GoodJob::Job(id: uuid, queue_name: text, priority: integer, serialized_params: jsonb, scheduled_at: datetime, performed_at: datetime, finished_at: datetime, error: text, created_at: datetime, updated_at: datetime, active_job_id: uuid, concurrency_key: text, cron_key: text)]`):
I also noticed that the URL auto change: if I want to access like localhost:3000/admin/good_job(which runs fine with 2.12.0 and lower) to localhost:3000/admin/good_job/jobs
I use good_job in administrate with pundit, here is the method by which error occurred:
def authorize(record, query = {})
super([:admin, record], **query)
end
Ruby version: 3.0.2 Rails version: 6.1.0
@hiendinhngoc thanks for opening the issue. That's weird.
GoodJob doesn't use Pundit, so I'm not sure why that authorize method would be triggered within GoodJob's Dashboard Engine. I'll have to dig into what's happening.
Here's the comparison between those versions in case something sticks out to you: https://github.com/bensheldon/good_job/compare/v2.11.3..v2.13.0
That's weird.
Yes, it works normally until 2.13.0. Thanks for your link, need a little bit of time to investigate it.
@hiendinhngoc Just looping back around on this. I'm curious if you ever discovered the problem?