#746·pundit

Split this into two methods?

Author: ioquatixCreated Oct 13, 2022Updated Aug 8, 2024
Labelssimmering

It would be nice if this method either returned the policy class checked, or if there was some way to determine this without re-implementing the policy lookup logic.

https://github.com/varvet/pundit/blob/56af8f3ce25bf1eea47ec877f840b3de6fb32cdc/lib/pundit.rb#L76

One way would be to split this into two methods:

  • Map incoming arguments to a policy.
  • Raise an exception if the policy isn't satisified.

Would you accept a PR for this?