There is an SQL generation problem where a scoped association with
composite primary keys gets generated with SQL like:
FROM `table1` INNER JOIN `table2` ON AND
ON and AND are not supposed to be next to one another.
This adds a test to uncover the issue, and then fixes it with a patch.
The problem seems to be that append_constraints assumes that right.expr is non-empty, but in the case of CPK it is sometimes empty, presumably because id constraints have been removed.
Continuation of #560.
There is an SQL generation problem where a scoped association with composite primary keys gets generated with SQL like:
ON and AND are not supposed to be next to one another.
This adds a test to uncover the issue, and then fixes it with a patch.
The problem seems to be that
append_constraints
assumes thatright.expr
is non-empty, but in the case of CPK it is sometimes empty, presumably because id constraints have been removed.Tests passing here: https://github.com/ryantm/composite_primary_keys/pull/2/checks