The documentation shows that Query.where(role: "admin").or_where(role: "user") should generate a query that is something like WHERE role=? OR role=?.
However as pointed out by @jianghengle it actually generates in invalid query: WHERE role=? WHERE role=?.
or_where as it exists right now, performs the OR query between the parameters that are passed to it. Query.or_where(role: "admin", role: "user") would generated the correct OR query.
This is probably misleading, and also the documentation is wrong.
The documentation shows that
Query.where(role: "admin").or_where(role: "user")should generate a query that is something likeWHERE role=? OR role=?.However as pointed out by @jianghengle it actually generates in invalid query:
WHERE role=? WHERE role=?.or_whereas it exists right now, performs theORquery between the parameters that are passed to it.Query.or_where(role: "admin", role: "user")would generated the correctORquery.This is probably misleading, and also the documentation is wrong.