-
-
Notifications
You must be signed in to change notification settings - Fork 270
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 TableName
cop
#574
Add TableName
cop
#574
Conversation
cd483d8
to
a56d391
Compare
|
@koic I do like |
Here's a digest of
|
I wonder if it's also worth mentioning that in some cases a better approach would be to configure an inflection. |
Looking at the list @pirj shared, I think |
And specs, too. |
f1a34b1
to
4faaf0c
Compare
Apparently, table name convention doesn't work that well with STI base classes: |
@MaximeDucheneS ping |
@MaximeDucheneS Ping. |
@pirj I don't have much experience with these. I'm wondering if naming those classes |
That would definitely reduce the number of false positives. |
e110255
to
39b462c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering that this is Enabled: false
, I'm totally fine with this cop.
Thank you for the contribution! |
e0bec7d
to
e6541be
Compare
@MaximeDucheneS This looks good to me. Can you squash your commits into one? |
4386837
to
9e73089
Compare
@koic Done! |
Thanks! |
Adds a cop that will check for uses of
self.table_name=
.See https://rails.rubystyle.guide/#keep-ar-defaults for more details.
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.and description in grammatically correct, complete sentences.
bundle exec rake default
. It executes all tests and RuboCop for itself, and generates the documentation.