You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the first (non-polymorphic) line works fine, but the second one raises this:
BugTest#test_association_stuff:
ActiveRecord::StatementInvalid: PG::ProtocolViolation: ERROR: bind message supplies 0 parameters, but prepared statement "" requires 1
: SELECT DISTINCT "posts"."id", notes.category AS alias_0 FROM "posts" LEFT OUTER JOIN "notes" ON "notes"."notable_id" = "posts"."id" AND "notes"."notable_type" = $1 ORDER BY notes.category LIMIT 1
This came up when trying out the 4.2.0 beta, and it happens on the master branch too. Works perfectly fine through 4.1.5.
I searched and the only recent issue that seems to be possibly related is #15821
The text was updated successfully, but these errors were encountered:
dmarkow
changed the title
Postgresql bind errors when including polymorphic associations
PostgreSQL bind errors when including polymorphic associations
Aug 20, 2014
This is cased by 03118bc + 9b5d603. The first commit referenced the undefined
local variable `column` when it should be using `reflection.type` as the lookup
key. The second commit changed `build_arel` to not modify the `bind_values` in-
place so we need to combine the arel's `bind_values` with the relation's when
building the SQL.
Fixesrails#16591
Related rails#15821 / rails#15892 / 7aeca50
Test Case: https://gist.github.com/dmarkow/c27d00bc4fb030f2dce5
With this setup:
and a test case that does this:
the first (non-polymorphic) line works fine, but the second one raises this:
This came up when trying out the 4.2.0 beta, and it happens on the master branch too. Works perfectly fine through 4.1.5.
I searched and the only recent issue that seems to be possibly related is #15821
The text was updated successfully, but these errors were encountered: