Skip to content
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

The fix for RedundantActiveRecordAllMethod::AllowedReceivers in 2.22.1 doesn't work #1173

Closed
aruzmanov2 opened this issue Oct 30, 2023 · 0 comments · Fixed by #1174
Closed
Labels
bug Something isn't working

Comments

@aruzmanov2
Copy link

aruzmanov2 commented Oct 30, 2023

The module defined in

is included in class before the actual module definition. Moving module definition before the include statement fixes the problem.

Expected behavior

Rubocop works normally

Actual behavior

An exception is thrown:

uninitialized constant RuboCop::Cop::Rails::RedundantActiveRecordAllMethod::AllowedReceivers
/Users/aruzmanov/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/rubocop-rails-2.22.1/lib/rubocop/cop/rails/redundant_active_record_all_method.rb:30:in `<class:RedundantActiveRecordAllMethod>'
/Users/aruzmanov/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/rubocop-rails-2.22.1/lib/rubocop/cop/rails/redundant_active_record_all_method.rb:28:in `<module:Rails>'
/Users/aruzmanov/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/rubocop-rails-2.22.1/lib/rubocop/cop/rails/redundant_active_record_all_method.rb:5:in `<module:Cop>'
/Users/aruzmanov/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/rubocop-rails-2.22.1/lib/rubocop/cop/rails/redundant_active_record_all_method.rb:4:in `<module:RuboCop>'
/Users/aruzmanov/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/rubocop-rails-2.22.1/lib/rubocop/cop/rails/redundant_active_record_all_method.rb:3:in `<top (required)>'

Steps to reproduce the problem

RuboCop version

1.50.2

@koic koic added the bug Something isn't working label Oct 31, 2023
koic added a commit to koic/rubocop-rails that referenced this issue Oct 31, 2023
…thod` cop

Fixes rubocop#1173.

This PR fixes an error for `Rails/RedundantActiveRecordAllMethod` cop
when using RuboCop 1.51 or lower.
koic added a commit to koic/rubocop-rails that referenced this issue Oct 31, 2023
…thod` cop

Fixes rubocop#1173.

This PR fixes an error for `Rails/RedundantActiveRecordAllMethod` cop
when used with RuboCop 1.51 or lower.
Additionally, it introduces a CI matrix for regression testing with
the oldest supported RuboCop version.
koic added a commit to koic/rubocop-rails that referenced this issue Oct 31, 2023
…thod` cop

Fixes rubocop#1173.

This PR fixes an error for `Rails/RedundantActiveRecordAllMethod` cop
when used with RuboCop 1.51 or lower.
Additionally, it introduces a CI matrix for regression testing with
the oldest supported RuboCop version.
koic added a commit to koic/rubocop-rails that referenced this issue Oct 31, 2023
…thod` cop

Fixes rubocop#1173.

This PR fixes an error for `Rails/RedundantActiveRecordAllMethod` cop
when used with RuboCop 1.51 or lower.
Additionally, it introduces a CI matrix for regression testing with
the oldest supported RuboCop version.
koic added a commit that referenced this issue Nov 18, 2023
…ve_record_all_method

[Fix #1173] Fix an error for `Rails/RedundantActiveRecordAllMethod` cop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants