diff --git a/fixtures/queryer.json b/fixtures/queryer.json index ddb1ac0..93c08e9 100644 --- a/fixtures/queryer.json +++ b/fixtures/queryer.json @@ -2461,11 +2461,13 @@ "constraint": "fk_attachment_attachable_entity", "source_type": "attachment", "source_columns": [ - "attachable_id" + "attachable_id", + "attachable_type" ], "destination_type": "entity", "destination_columns": [ - "id" + "id", + "type" ], "prefix": "attachable" } diff --git a/src/queryer/compiler.rs b/src/queryer/compiler.rs index 8d9f8db..0a93239 100644 --- a/src/queryer/compiler.rs +++ b/src/queryer/compiler.rs @@ -621,9 +621,6 @@ impl<'a> Compiler<'a> { if edge.forward && relation.source_columns.len() > 1 { poly_col = Some(&relation.source_columns[1]); // e.g., target_type table_to_alias = &relation.source_type; // e.g., relationship - } else if !edge.forward && relation.destination_columns.len() > 1 { - poly_col = Some(&relation.destination_columns[1]); // e.g., source_type - table_to_alias = &relation.destination_type; // e.g., relationship } if let Some(col) = poly_col {