Open singpolyma-shopify opened 5 years ago
SELECT c1.* FROM configurations c1 LEFT OUTER JOIN configurations c2 on c1.thing = c2.otherthing
Gives
Configuration.select(C1.arel_table[Arel.star]).joins( Configuration.arel_table.join(Configuration.arel_table, Arel::Nodes::OuterJoin).on( C1.arel_table[:thing].eq(C2.arel_table[:otherthing]) ).join_sources )
Assuming that C1 and C2 are tables when they're actually two aliases of the two sides of a self-join.
C1
C2
Hey @singpolyma-shopify, thanks for the bug report. I don't really have time to work on this right now, but would gladly accept a pull request :)
Gives
Assuming that
C1
andC2
are tables when they're actually two aliases of the two sides of a self-join.