You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
initial_query and left_joins are methods on the same model.
Expected behavior
The two examples above should not cause Rails/WhereMissing to fail.
Actual behavior
Running Rubocop results in the following output:
2 errors occurred:
An error occurred while Rails/WhereMissing cop was inspecting /.../app/models/model_1.rb:36:26.
An error occurred while Rails/WhereMissing cop was inspecting /.../app/models/model_2.rb:17:17.
No cops failed and all other inspections run properly.
Steps to reproduce the problem
Create a minimal Rails app (rails new app_name --minimal)
Add rubocop and robocop-rails to the group :development, :test in Gemfile and run bundle install:
❯ bundle exec rubocop
Inspecting 32 files
................................
32 files inspected, no offenses detected
An error occurred while Rails/WhereMissing cop was inspecting /Users/abcde/rubocop-error/app/models/user.rb:7:30.
To see the complete backtrace run rubocop -d.
1 error occurred:
An error occurred while Rails/WhereMissing cop was inspecting /Users/abcde/rubocop-error/app/models/user.rb:7:30.
Errors are usually caused by RuboCop bugs.
Please, report your problems to RuboCop's issue tracker.
https://github.com/rubocop/rubocop/issues
Mention the following information in the issue report:
1.58.0 (using Parser 3.2.2.4, rubocop-ast 1.30.0, running on ruby 2.7.8) +server [arm64-darwin22]```
## RuboCop version
1.58.0 (using Parser 3.2.2.4, rubocop-ast 1.30.0, running on ruby 2.7.8) +server [arm64-darwin22]
- rubocop-rails 2.22.2
The text was updated successfully, but these errors were encountered:
Seeing two errors in the
Rails/WhereMissing
inspections in my codebase.Here are the two spots in the code where it fails:
model_1.rb:
other_models
is a relatedhas_many
model;left_outer_joins
is a method on the same model.model_2.rb:
initial_query
andleft_joins
are methods on the same model.Expected behavior
The two examples above should not cause
Rails/WhereMissing
to fail.Actual behavior
Running Rubocop results in the following output:
No cops failed and all other inspections run properly.
Steps to reproduce the problem
rails new app_name --minimal
)rubocop
androbocop-rails
to thegroup :development, :test
inGemfile
and runbundle install
:.rubocop.yml
as follows:bundle exec rubocop -A
- lots of corrections, but no errors.User
model as follows:bundle exec rubocop
and you'll see the error:The text was updated successfully, but these errors were encountered: