-
-
Notifications
You must be signed in to change notification settings - Fork 261
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/WhereRange
output the error if using ternary operator.
#1281
Labels
bug
Something isn't working
Comments
fatkodima
added a commit
to fatkodima/rubocop-rails
that referenced
this issue
Jun 7, 2024
koic
added a commit
that referenced
this issue
Jun 8, 2024
…ssions [Fix #1281] Fix `WhereRange` autocorrect for complex expressions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected behavior
This code expected to be autocorrect with parentheses parameter.
expected
Actual behavior
Actual is output the error. (w/o autocorrect option
-a
too)Additionally, autocorrected code will not have parentheses for ternary operator.
Range operators (
..
,...
) have higher precedence than ternary operator (?
,:
), so this autocorrected code will not provide range object towhere
method.Steps to reproduce the problem
Create ruby file that using ternary operator for where like above example then autocorrect it with
Rails/WhereRange
.RuboCop version
The text was updated successfully, but these errors were encountered: