Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upNot working: parent.join(child.join(grandchild)) [in some cases] #1068
Comments
This comment has been minimized.
|
Your names are backwards FYI. You're trying to go grandchild -> child -> parent |
This comment has been minimized.
valeriansaliou
commented
Aug 4, 2017
|
Yeah it's backwards, because otherwise I get:
|
This comment has been minimized.
|
The code and error should be identical. Just your naming is wrong. What you're calling |
added a commit
that referenced
this issue
Aug 4, 2017
added a commit
that referenced
this issue
Aug 4, 2017
added a commit
that referenced
this issue
Aug 4, 2017
sgrif
closed this
in
#1069
Aug 4, 2017
added a commit
that referenced
this issue
Aug 4, 2017
This comment has been minimized.
valeriansaliou
commented
Aug 4, 2017
|
Thanks a ton @sgrif |
This comment has been minimized.
|
Don't thank me yet. I have a lot more work to do to get rid of the fallout from that change. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
valeriansaliou commentedAug 4, 2017
•
edited
Setup
Versions
Feature Flags
Problem Description
In certain relational schemas, performing a
parent.join(child.join(grandchild))doesn't work as expected (joincan be aninner_joinorleft_join, same error).The same code, using the simpler
parent.join(child.join)call works.If I change the schema and reverse the belongs_to relation between parent and child, the nested join works just fine. However that's the schema I want to rely on, plus my schema is SQL-valid.
What are you trying to accomplish?
I'm trying to perform a join w/ the following structure:
parent.join(child.join(grandchild))Given the following schema:
And the following model:
What is the expected output?
The expected output is the equivalent of the full-SQL request:
Which works just fine in a PG prompt, based on the bare SQL schema defined above.
What is the actual output?
Getting the following error when compiling, although all relevant
belongs_toandenable_multi_table_joins!are set.Are you seeing any additional errors?
No, only this one.
Steps to reproduce