You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
User.where(hair_color: 'brunette', figure: 'slim').or.where(hair_color: 'blonde', figure: 'normal')
SELECT users.* FROM users WHERE ((users.hair_color = 'brunette' AND users.figure = 'slim' OR users.hair_color = 'blonde' AND users.figure = 'normal'))
Need to wrap both sides of the OR in parenthesis. This is the SQL what I expect:
SELECT users.* FROM users WHERE ((users.hair_color = 'brunette' AND users.figure = 'slim') OR (users.hair_color = 'blonde' AND users.figure = 'normal'))
The text was updated successfully, but these errors were encountered:
User.where(hair_color: 'brunette', figure: 'slim').or.where(hair_color: 'blonde', figure: 'normal')
SELECT
users
.* FROMusers
WHERE ((users
.hair_color
= 'brunette' ANDusers
.figure
= 'slim' ORusers
.hair_color
= 'blonde' ANDusers
.figure
= 'normal'))Need to wrap both sides of the OR in parenthesis. This is the SQL what I expect:
SELECT
users
.* FROMusers
WHERE ((users
.hair_color
= 'brunette' ANDusers
.figure
= 'slim') OR (users
.hair_color
= 'blonde' ANDusers
.figure
= 'normal'))The text was updated successfully, but these errors were encountered: