-
-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Cop for Superclass ActionPolicy to ApplicationPolicy #803
Comments
hoshy
added a commit
to hoshy/rubocop-rails
that referenced
this issue
Oct 7, 2022
When using the active_policy gem you should create an ApplicationPolicy class and inherit your resource policies from it.
Hm, RuboCop Rails basically targets Rails core features. So, I'm close this proposal because Active Policy is not a Rails core features. As an alternative, it's probably better to make a custom cop to Action Policy (or 3rd party gem) instead of RuboCop Rails. Thank you. |
hoshy
added a commit
to hoshy/rubocop-rails
that referenced
this issue
Oct 7, 2022
When using the active_policy gem you should create an ApplicationPolicy class and inherit your resource policies from it.
You'll find the gem here https://github.com/Nordplaner/rubocop-action_policy |
hoshy
changed the title
Add Cop for Superclass ActivePolicy to ApplicationPolicy
Add Cop for Superclass ActionPolicy to ApplicationPolicy
Oct 12, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
When using the action_policy you should create an
ApplicationPolicy
class and inherit your resource policies from it (like you do with theResourceController
andApplicationController
in Rails).It would be great, if Rubocop could check and auto-correct, that policies subclass
ApplicationPolicy
.Solution
Implement a cop thats checks, that policies subclass
ApplicationPolicy
and may auto-correct findings – similar to theRails/ApplicationController
-Cop.Additional context
I'm currently working on an implementation and will create a PR asap - stay tuned ;-).
The text was updated successfully, but these errors were encountered: