varvet / godmin

Admin framework for Rails 5+
http://godmin-sandbox.herokuapp.com
MIT License
486 stars 47 forks source link

Fix: require pundit 2.0 #260

Closed dgmstuart closed 3 years ago

dgmstuart commented 3 years ago

The namespacing feature we're using has a bug which was fixed in Pundit 2.0:

https://github.com/varvet/pundit/pull/529

The namespace is required to look up the policy, but without this fix it gets passed as the record in the policy, so the policy is trying to do logic on an array like:

[:admin, Widget]

...rather than on the actual record:

Widget