add brackets to expression for precedence handling

This commit is contained in:
Bilal Catic
2020-01-31 13:27:11 +01:00
parent 2dc2453039
commit 0286f3ed81

View File

@@ -74,6 +74,6 @@ class TextToSqlQuery
second_operand_expression = second_operand.first
second_operand_params = second_operand[1..]
["#{first_operand_expression} #{operator.to_s} #{second_operand_expression}"] + first_operand_params + second_operand_params
["(#{first_operand_expression} #{operator.to_s} #{second_operand_expression})"] + first_operand_params + second_operand_params
end
end