We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I had a possible false positive for this rule when I used a local method named update_attributes.
def update_attributes(raw_attributes) { name: raw_attributes['nome'], date_of_birth: Date.parse(raw_attributes['dataDeNascimento']), document_number: raw_attributes['NumeroDoDocumento'] } end user = User.find(1) user.update(update_attributes)
No issue was pointed out.
W: [Correctable] Rails/ActiveRecordAliases: Use update instead of update_attributes.
app/models/user_test.rb
bundle exec rubocop app/models/user_test.rb
1.35.0 (using Parser 3.1.2.1, rubocop-ast 1.21.0, running on ruby 3.0.3 x86_64-linux-musl) - rubocop-performance 1.15.0 - rubocop-rails 2.16.1 - rubocop-rspec 2.13.2
The text was updated successfully, but these errors were encountered:
[Fix rubocop#898] Fix a false positive for Rails/ActiveRecordAliases
Rails/ActiveRecordAliases
9d7afad
Fixes rubocop#898. This PR fixes a false positive for `Rails/ActiveRecordAliases` when arguments of `update_attributes` is empty.
Merge pull request #899 from koic/fix_a_false_positive_for_rails_acti…
9020b77
…ve_record_aliases [Fix #898] Fix a false positive for `Rails/ActiveRecordAliases`
Successfully merging a pull request may close this issue.
I had a possible false positive for this rule when I used a local method named update_attributes.
Expected behavior
No issue was pointed out.
Actual behavior
W: [Correctable] Rails/ActiveRecordAliases: Use update instead of update_attributes.
Steps to reproduce the problem
app/models/user_test.rb
;bundle exec rubocop app/models/user_test.rb
RuboCop version
The text was updated successfully, but these errors were encountered: