Skip to content
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 to standardrb to enforce Mod::ModeratorController #1393 #1405

Merged
merged 1 commit into from
Dec 26, 2024

Conversation

dreig
Copy link
Contributor

@dreig dreig commented Dec 22, 2024

All controllers in the app/controllers/mod/ directory should inherit from Mod::ModeratorController
resolves #1393

Note:
The cops are located in the .lib/custom_cops/ directory, which I've added to the ignore list of config.autolod_libs. If my understanding of config.autoload_libs(ignore:) is correct, this should prevent this directory from being loaded when the application runs (in any environment).

If your editor is configured with standardrb integration, the code in .lib/custom_cops/ will load and will run for ruby files in the app/controllers/mod/ directory.

All controllers in the `app/controllers/mod/` directory should inherit from `Mod::ModeratorController`
@pushcx
Copy link
Member

pushcx commented Dec 26, 2024

Sorry this took me a minute to get to, I was sick and then traveling for the holiday.

This is a totally clear implementation, I’m really happy to merge it so I don’t footgun myself by creating a controller that doesn’t inherit from ModController for the authorization. Thank you!

@pushcx pushcx merged commit 0cdf414 into lobsters:master Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a cop to our standardrb to enforce Mod::ModeratorController
2 participants