varvet / pundit

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

Split this into two methods? #746

Open ioquatix opened 1 year ago

ioquatix commented 1 year ago

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:

Would you accept a PR for this?