-
-
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
[Fix: #1110] Fix false positive for Rails/RedundantActiveRecordAllMethod
when all
has any parameters
#1114
[Fix: #1110] Fix false positive for Rails/RedundantActiveRecordAllMethod
when all
has any parameters
#1114
Conversation
aa29805
to
0dcbf2b
Compare
Rails/RedundantActiveRecordAllMethod
when all
has arguments
Rails/RedundantActiveRecordAllMethod
when all
has argumentsRails/RedundantActiveRecordAllMethod
when all
has arguments
0dcbf2b
to
f0b27f9
Compare
Rails/RedundantActiveRecordAllMethod
when all
has argumentsRails/RedundantActiveRecordAllMethod
when all
has parameters
Rails/RedundantActiveRecordAllMethod
when all
has parametersRails/RedundantActiveRecordAllMethod
when all
has any parameters
90620b1
to
b573569
Compare
@@ -260,6 +260,26 @@ | |||
RUBY | |||
end | |||
end | |||
|
|||
context 'when `all` has any parameters (indicating it is not an Active Record `all`)' do |
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.
Can you tweak the text?
context 'when `all` has any parameters (indicating it is not an Active Record `all`)' do | |
context 'when `all` has any parameters, it indicates that it is not an Active Record `all`' do |
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.
Thank you for the review. I've updated the context name.
…rdAllMethod` when `all` has any parameters
b573569
to
a731016
Compare
Thanks! |
I'm afraid this doesn't fix all false positives. An example wold be
|
Resolves rubocop#1114 (comment) This PR fixes a false positive for `RedundantActiveRecordAllMethod` when using `find` with block argument. `Enumerable#find` and `ActiveRecord::Base#find` have different arguments, So false positives can be prevented.
Resolves rubocop#1114 (comment) This PR fixes a false positive for `RedundantActiveRecordAllMethod` when using `find` with block argument. `Enumerable#find` and `ActiveRecord::Base#find` have different arguments, So false positives can be prevented.
Resolves rubocop#1114 (comment) This PR fixes a false positive for `RedundantActiveRecordAllMethod` when using `find` with block argument. `Enumerable#find` and `ActiveRecord::Base#find` have different arguments, So false positives can be prevented.
Resolves rubocop#1114 (comment) This PR fixes a false positive for `RedundantActiveRecordAllMethod` when using `find` with block argument. `Enumerable#find` and `ActiveRecord::Base#find` have different arguments, So false positives can be prevented.
Resolves rubocop#1114 (comment) This PR fixes a false positive for `Rails/RedundantActiveRecordAllMethod` when using `find` with block argument. `Enumerable#find` and `ActiveRecord::Base#find` have different arguments, So false positives can be prevented.
Resolves rubocop#1114 (comment) This PR fixes a false positive for `Rails/RedundantActiveRecordAllMethod` when using `Enumerable`'s methods with block argument. `Enumerable#find` and `ActiveRecord::Base#find` have different arguments, So false positives can be prevented.
Resolves rubocop#1114 (comment) This PR fixes a false positive for `Rails/RedundantActiveRecordAllMethod` when using some `Enumerable`'s methods with block argument. `Enumerable#find` and `ActiveRecord::Base#find` have different arguments, So false positives can be prevented.
Resolves rubocop#1114 (comment) This PR fixes a false positive for `Rails/RedundantActiveRecordAllMethod` when using some `Enumerable`'s methods with block argument. e.g. `Enumerable#find` and `ActiveRecord::Base#find` have different arguments, So false positives can be prevented.
Resolves rubocop#1114 (comment) This PR fixes a false positive for `Rails/RedundantActiveRecordAllMethod` when using some `Enumerable`'s methods with block argument. e.g. `Enumerable#find` and `ActiveRecord::Base#find` have different arguments, So false positives can be prevented.
Resolved the following issue: #1110
As pointed out in the mentioned issue, there was an oversight. I apologize for the mistake.
In this PR, the cop treats
all
with parameters as not being an ActiveRecord method and excludes it from offenses.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.[ ] If this is a new cop, consider making a corresponding update to the Rails Style Guide.