varvet / pundit

Minimal authorization through OO design and pure Ruby classes
MIT License
8.24k stars 627 forks source link

Pass record correctly when using `policy_class` #694

Closed fqxp closed 2 years ago

fqxp commented 2 years ago

Fixes https://github.com/varvet/pundit/issues/689

This patch makes authorize remove namespaces before passing them to the constructor of policy_class, if defined.

Added tests accordingly.

kevin-j-m commented 2 years ago

Thanks for contributing this; I hope this gets resolved.

Burgestrand commented 2 years ago

Thanks for this! We built on top of this in #697, and will be merging it shortly.