Rails/WhereRange
output the error if using ternary operator.
#1281
Labels
bug
Something isn't working
Rails/WhereRange
output the error if using ternary operator.
#1281
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: