-
-
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
False positive for Rails/RedundantActiveRecordAllMethod cop in 2.21.0 #1110
Labels
bug
Something isn't working
Comments
|
masato-bkn
added a commit
to masato-bkn/rubocop-rails
that referenced
this issue
Sep 11, 2023
…rdAllMethod` when `all` has arguments
masato-bkn
added a commit
to masato-bkn/rubocop-rails
that referenced
this issue
Sep 11, 2023
…rdAllMethod` when `all` has arguments
masato-bkn
added a commit
to masato-bkn/rubocop-rails
that referenced
this issue
Sep 11, 2023
…rdAllMethod` when `all` has arguments
masato-bkn
added a commit
to masato-bkn/rubocop-rails
that referenced
this issue
Sep 11, 2023
…rdAllMethod` when `all` has arguments
8 tasks
masato-bkn
added a commit
to masato-bkn/rubocop-rails
that referenced
this issue
Sep 11, 2023
…rdAllMethod` when `all` has any parameters
masato-bkn
added a commit
to masato-bkn/rubocop-rails
that referenced
this issue
Sep 11, 2023
…rdAllMethod` when `all` has any parameters
masato-bkn
added a commit
to masato-bkn/rubocop-rails
that referenced
this issue
Sep 11, 2023
…rdAllMethod` when `all` has any parameters
koic
added a commit
that referenced
this issue
Sep 12, 2023
…ecord_all_when_all_has_arguments [Fix: #1110] Fix false positive for `Rails/RedundantActiveRecordAllMethod` when `all` has any parameters
Thank you for the quick fix! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The cop is detecting calls to
all
on any object, not just ActiveRecord models. Using RSpec and Capybara, it can be useful to write code like:This is detected by the cop even though
all
andfirst
do not refer to ActiveRecord methods.Expected behavior
The cop should only complain about ActiveRecord's
all
method.Actual behavior
Steps to reproduce the problem
RuboCop version
Include the output of
rubocop -V
orbundle exec rubocop -V
if using Bundler. Here's an example:You can see extension cop versions (e.g. rubocop-rails, rubocop-performance, and others) output by rubocop -V,
include them as well. Here's an example:
The text was updated successfully, but these errors were encountered: