Skip to content
This repository was archived by the owner on Sep 21, 2020. It is now read-only.
This repository was archived by the owner on Sep 21, 2020. It is now read-only.

interpolating values #118

@ginter

Description

@ginter

When I embed a value directly into a query as so:

Bid.where("miscellaneous @> ('model_number=>ABC-123')")

SELECT "bids".* FROM "bids" WHERE (miscellaneous @> ('model_number=>ABC-123'))

the query works. But when I try to interpolate with a ? it adds an extra set of single quotes which raises an error:

Bid.where("miscellaneous @> ('model_number=>?)", 'ABC-123')
SELECT "bids".* FROM "bids" WHERE (miscellaneous @> ('model_number=>'ABC-123''))
PG::SyntaxError: ERROR: syntax error at or near "ABC"

What am I missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions