-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
No correction for errors.details[:n] << v
#741
No correction for errors.details[:n] << v
#741
Conversation
a5fa36d
to
cf2c8a5
Compare
You can do Maybe we should add an example of a correction using This can be done as a later doc PR, if need be. |
@koic as requested. |
@BrianHawley Can you rebase with the latest master branch? |
cf2c8a5
to
c77b27b
Compare
@koic rebased. |
receiver = node.receiver.receiver | ||
!AUTOCORRECTABLE_METHODS.include?(node.method_name) || ( | ||
receiver&.send_type? && receiver&.method?(:details) && node.method?(:<<) | ||
) |
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.
That just my two cents. Can you tweak it?
receiver = node.receiver.receiver | |
!AUTOCORRECTABLE_METHODS.include?(node.method_name) || ( | |
receiver&.send_type? && receiver&.method?(:details) && node.method?(:<<) | |
) | |
return true unless AUTOCORRECTABLE_METHODS.include?(node.method_name) | |
return false unless (receiver = node.receiver.receiver) | |
receiver.send_type? && receiver.method?(:details) && node.method?(:<<) |
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.
@koic sure, done.
Fixes for Rails/DeprecatedActiveModelErrorsMethods: - Fixed a bad autocorrection of `errors.details[:name] << value`. There isn't really a correct replacement for this one. - Did some refactors prompted by rubocop complaints. - Fixed a misspelling of autocorrectable. - Added missing correction assertions to test cases.
c77b27b
to
d0a12a6
Compare
Thanks! |
Fixes for Rails/DeprecatedActiveModelErrorsMethods:
errors.details[:name] << value
.There isn't really a correct replacement for this one.
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.