Skip to content

Conversation

@nilmerg
Copy link
Member

@nilmerg nilmerg commented Jul 7, 2025

If you wonder why the junction's actual alias (if there's one) is not overridden: The only place where this is processed, is where resolve() is called. And that's, at the moment, only the Query. But this uses aliases defined earlier and in case of BelongsToMany relations, this is done when a relation path is resolved. Which is why you will find a call to getThroughAlias() there.

resolves #147

@nilmerg nilmerg requested a review from sukhwinder33445 July 7, 2025 13:50
@nilmerg nilmerg self-assigned this Jul 7, 2025
@nilmerg nilmerg added the enhancement New feature or request label Jul 7, 2025
@cla-bot cla-bot bot added the cla/signed label Jul 7, 2025
@nilmerg nilmerg added this to the v0.7.0 milestone Jul 7, 2025
@nilmerg nilmerg force-pushed the allow-belongstomany-to-define-a-junction-alias-147 branch from 0b8d939 to 0cb2d87 Compare July 7, 2025 13:57
If you wonder why the junction's actual alias (if there's one)
is not overridden: The only place where this is processed, is
where `resolve()` is called. And that's, at the moment, only
the `Query`. But this uses aliases defined earlier and in
case of `BelongsToMany` relations, this is done when a relation
path is resolved. Which is why you will find a call to
`getThroughAlias()` there.

resolves #147
@nilmerg nilmerg force-pushed the allow-belongstomany-to-define-a-junction-alias-147 branch from 7d3261c to 22cb565 Compare July 9, 2025 12:32
@nilmerg nilmerg requested a review from sukhwinder33445 July 9, 2025 12:33
@nilmerg nilmerg force-pushed the allow-belongstomany-to-define-a-junction-alias-147 branch from 22cb565 to 1cc1143 Compare July 9, 2025 12:35
@nilmerg nilmerg merged commit 4893731 into main Jul 10, 2025
10 checks passed
@nilmerg nilmerg deleted the allow-belongstomany-to-define-a-junction-alias-147 branch July 10, 2025 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla/signed enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow BelongsToMany relations to define a junction alias

3 participants