Skip to content

or_where does not work as expected #179

@fridgerator

Description

@fridgerator

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions