-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PG::UndefinedParameter: ERROR: there is no parameter $1 #59
Comments
Please try with master, I think this is already fixed. |
@felixbuenemann Hi, I tried with:
the new version is:
I have the same error:
|
It's hard to say with all the anonymised queries, but have you tried this? @model1.model2.joins(:model3).where("model3.state = 'done'") You don't really need a prepared statement for a static string. Another possible solution using a subquery: model3_ids = Model3.where(state: 'done').select(:id)
@model1.model2.where(model3_id: model3_ids) The subquery approach is often faster than a join. |
Not works, I have the same error:
I think is error is of rails 4, the sql result is:
|
Can you post the result of calling It looks like you have some code that is trying to do preloading and none of the examples I posted above would trigger that. |
the result of sql:
and query
and the result of json query when I used a serializer
|
Ah, that should be easy to fix. Try |
Hi!
I have of next versions:
my query is:
@model1.model2.includes(:model3).where('model3.state =?', 'done')
I have a error when run:
json = ActiveModel::ArraySerializer.new(ts, each_serializer: Api::V1::MySerializer).to_json
or
Could you help me?
Thanks a lot!
The text was updated successfully, but these errors were encountered: