Skip to content
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

[8.x] Make use of specified ownerKey in MorphTo::associate() #36296

Closed
wants to merge 1 commit into from
Closed

[8.x] Make use of specified ownerKey in MorphTo::associate() #36296

wants to merge 1 commit into from

Conversation

garbetjie
Copy link
Contributor

Currently, when calling MorphTo::associate(), the $ownerKey property defined in the relationship is ignored and the associated model's primary key is always used.

This is a small PR to use the value of the attribute defined in $ownerKey if $ownerKey is not empty. If $ownerKey is empty, it defaults to the model's primary key.

@GrahamCampbell GrahamCampbell changed the title Make use of specified ownerKey in MorphTo::associate() [8.x] Make use of specified ownerKey in MorphTo::associate() Feb 17, 2021
@taylorotwell
Copy link
Member

Hey there - it looks like the tests are failing. Could you resubmit this with passing tests?

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