-
Notifications
You must be signed in to change notification settings - Fork 571
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 morphTo options.query #2059
Fix morphTo options.query #2059
Conversation
Don't use same query builder for all candidates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test case for this issue? That should help ensure it's not re-introduced at a later time.
@ricardograca Added a passing test (finally) that fails if I remove my fix. |
@ricardograca I changed the test setup to better fit the existing structure, please check to see if it makes sense. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! It's better now.
@ricardograca Great! Thanks. When can we expect the next version to be published? |
Don't use same query builder for all candidates
Introduction
fetching
event gets same query builder for all morphTo candidates.Motivation
We're using on('fetching', ..) to add deleted_at check for relations, but this fails for morphTo relations, since opts.query is the same regardless of candidate.
Proposed solution
Remove query from options prior to sending it to sync, solves this issue.
Current PR Issues
No issues known.
Alternatives considered
No alternatives considered.