User.where(is_individual: true)
.includes(:visitor)
.where(visitors: { finished: false })
.where(visitors: { step > 2 })
I am trying to get the out of the above query but it is returning an error
syntax error, unexpected '}', expecting =>)
...visitors: { step > 2 })
But if I do as below then it works.
User.where(is_individual: true)
.includes(:visitor)
.where(visitors: { finished: false })
.where(visitors: { step: 2 })
So the query doesn't work with greater than operator.
I even tried below query and it still doesn't work
User.where(is_individual: true)
.includes(:visitor)
.where(visitors: { finished: false })
.where(visitors: { "step > ?", 2 })