Closed
Description
Expected behavior
Redshift::User.where('mysql.users.status = ?', 1)
not report offenses for this code that contains where clause database_name.table_name.column_name
style query.
That is rubocop-rails v2.25.1 behavior.
NOTE: This query is a query to mysql via Redshift using Redshift Federated Query.
Actual behavior
$ bundle exec rubocop test.rb
Inspecting 1 file
C
Offenses:
test.rb:1:16: C: [Correctable] Rails/WhereEquals: Use where(mysql: { users: 1 }) instead of manually constructing SQL.
Redshift::User.where('mysql.users.status = ?', 1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 file inspected, 1 offense detected, 1 offense autocorrectable
report offense with not equivalent auto correction code.
Steps to reproduce the problem
- Create file with
Redshift::User.where('mysql.users.status = ?', 1)
- run rubocop with rubocop-rails
RuboCop version
Include the output of rubocop -V
or bundle 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:
$ be rubocop -V
1.65.1 (using Parser 3.3.4.2, rubocop-ast 1.32.1, running on ruby 3.3.4) [arm64-darwin23]
- rubocop-capybara 2.21.0
- rubocop-erb 0.5.3
- rubocop-factory_bot 2.26.1
- rubocop-graphql 1.5.4
- rubocop-performance 1.21.1
- rubocop-rails 2.26.0
- rubocop-rspec 3.0.4
- rubocop-rspec_rails 2.30.0
- rubocop-slim 0.2.7
Activity