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

Rails/RedundantActiveRecordAllMethod has many many false positives #1117

Closed
john-h-k opened this issue Sep 13, 2023 · 1 comment
Closed

Rails/RedundantActiveRecordAllMethod has many many false positives #1117

john-h-k opened this issue Sep 13, 2023 · 1 comment
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@john-h-k
Copy link
Contributor

Expected behavior

Rails/RedundantActiveRecordAllMethod ignores .all when it is called with args, e.g Foo.all(blah)

Actual behavior

Rails/RedundantActiveRecordAllMethod removes .all when it is called with args, e.g Foo.all(blah), breaking the syntax.

It transforms:

Foo.baz(class: 'hello').all(type: 'div').first

into

Foo.baz(class: 'hello').(type: 'div')first

which is completely invalid syntax

Steps to reproduce the problem

See code above

RuboCop version

1.56.3 (using Parser 3.2.2.3, rubocop-ast 1.29.0, running on ruby 3.2.2) [aarch64-linux]
  - rubocop-rails 2.21.0
  - rubocop-rspec 2.23.2
@koic
Copy link
Member

koic commented Sep 13, 2023

This issue is a dup with #1110 and fixed by #1114. It will be released soon (Maybe tomorrow). Please wait a moment.

@koic koic added bug Something isn't working duplicate This issue or pull request already exists labels Sep 13, 2023
@koic koic closed this as completed Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants