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

interpolating values #118

Open
ginter opened this issue Dec 19, 2013 · 0 comments
Open

interpolating values #118

ginter opened this issue Dec 19, 2013 · 0 comments

Comments

@ginter
Copy link

ginter commented Dec 19, 2013

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant