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

fix: allow invalid nested includes for morph #99

Closed
wants to merge 2 commits into from

Conversation

SychO9
Copy link
Contributor

@SychO9 SychO9 commented Feb 17, 2024

Hello 👋🏼,

This PR allows the scenario where you have a morph relationship (collection of resources on a relationship) and you include a nested relationship which only exists on one of the resources from the collection.

Prior to the changes here, that would not be possible and an exception would be thrown.

For example:

If you have a morph relation subject of types (users, posts) and only posts has the relation author. Including subjet.author would not be possible.

@tobyzerner
Copy link
Owner

@SychO9 I've just added a test for this issue, and fixed an issue with includes not working for polymorphic relationships that point to collections. I don't think the code you've proposed is necessary. Can you verify that this solves your issue, or if not, come up with a failing test?

@SychO9
Copy link
Contributor Author

SychO9 commented Mar 30, 2024

@tobyzerner can confirm that has solved it 👍🏼

@SychO9 SychO9 deleted the sm/morph-includes-passive branch March 30, 2024 12:14
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