Closed SychO9 closed 6 months ago
@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?
@tobyzerner can confirm that has solved it 👍🏼
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 onlyposts
has the relationauthor
. Includingsubjet.author
would not be possible.