-
Notifications
You must be signed in to change notification settings - Fork 21.9k
removing duplicate code in railties/lib/rails/generators/resource_helper... #13771
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
Conversation
Thanks for your contribution! However, this is a cosmetic change, and as noted in the the contributing to rails guide, we have a policy of not accepting these kind of changes. I know this might be thinking, "sure, it might not be adding much value, but I already wrote the code, so the cost is already paid – by me – so why not just merge it"? The reason is that there are a lot of hidden cost in addition to writing the code itself.
Theses are just some examples of the hidden costs that are not so apparent from the surface. It's awesome that you want to contribute to Rails, please keep the PRs coming! All we ask is that you refrain from sending these types of changes in the future (and read the contribution guide :). I hope you'll understand! P.S. I'm not picking on you – it's just that we seem to be getting more PRs in the cosmetic changes category, and so I wanted to take this chance to explain our position and have something I can link to in the future. ❤️ 💚 💙 💛 💜 |
@chancancode I understand your point, but i am surprised to see that Rails community do not promote improving code quality. I am using code climate for past few months , and am confident that my commit will surely decrease method complexity, do not mind if you still think its a cosmetic change. |
Looks like it is not a cosmetic change neither duplicated code. Tests are broken with this change. |
@@ -16,12 +16,10 @@ def self.included(base) #:nodoc: | |||
def initialize(*args) #:nodoc: | |||
super | |||
if options[:model_name] | |||
controller_name = name | |||
self.name = options[:model_name] |
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.
Name gets changed here, so we cannot move controller_name
assignment below this line.
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.
Interesting. It appears that what looked like a cosmetic change caused unexpected downstream issues...
|
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.
ㅤ
rails@80e66cc: 11,638 additions and 11,661 deletions There are some commits in rails that touch a large amount of files and are cosmetic only. This file will do two things: * Blaming through the GitHub UI will not blame these commits * Locally you can use it with `--ignore-revs-file` https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt There surely are more commits worthy of being included here but I just ran into this one once again and would like to not do that again. This comment gets linked to quite often rails#13771 (comment) and while there seldom are large cosmetic changes, they do exist. Let's make the ones that did happen a bit less painful.
rails@80e66cc: 11,638 additions and 11,661 deletions There are some commits in rails that touch a large amount of files and are cosmetic only. This file will do two things: * Blaming through the GitHub UI will not blame these commits * Locally you can use it with `--ignore-revs-file` https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt There surely are more commits worthy of being included here but I just ran into this one once again and would like to not do that again. This comment gets linked to quite often rails#13771 (comment) and while there seldom are large cosmetic changes, they do exist. Let's make the ones that did happen a bit less painful.
rails@80e66cc: 11,638 additions and 11,661 deletions There are some commits in rails that touch a large amount of files and are cosmetic only. This file will do two things: * Blaming through the GitHub UI will not blame these commits * Locally you can use it with `--ignore-revs-file` https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt There surely are more commits worthy of being included here but I just ran into this one once again and would like to not do that again. This comment gets linked to quite often rails#13771 (comment) and while there seldom are large cosmetic changes, they do exist. Let's make the ones that did happen a bit less painful.
...s.rb