8000 fix: HasManyThrough and HasOneThrough not working by tsterker · Pull Request #105 · tighten/parental · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: HasManyThrough and HasOneThrough not working #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 16, 2022

Conversation

tsterker
Copy link
Contributor
@tsterker tsterker commented Oct 24, 2022

This MR fixes issues with HasOneThrough and HasManyThrough for self-joins.
In this case, the nested select would use the same table name/alias as the outer select.

This MR fixes this by replacing $instance->getTable() with $query->getModel()->getTable(), which contain the correct inner table alias that laravel assigned to it.

@tsterker tsterker force-pushed the fix-has-many-through branch from 88328b7 to f304838 Compare October 24, 2022 13:31
@tsterker
Copy link
Contributor Author

@JustSteveKing @calebporzio Friendly poke: Is there a chance to have this reviewed and potentially merged?

@calebporzio calebporzio merged commit 5511ee8 into tighten:master Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0