-
Notifications
You must be signed in to change notification settings - Fork 68
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
DOC Update cascade_deletes
information for has_many
relationships
#523
Conversation
This is a workaround until silverstripe/silverstripe-framework#9612 is resolved.
Co-authored-by: Guy Sartorelli <[email protected]>
Co-authored-by: Guy Sartorelli <[email protected]>
While it is supported, it just perhaps doesn't work the way people assume. So we need to make that clearer.
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 for making those changes - just one small addition and then I'll be happy.
It can be argued that deleting _is_ also unlinking, so removing this to avoid confusion.
Co-authored-by: Guy Sartorelli <[email protected]>
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 for doing this, it's a great clarification to have.
I'll merge once CI goes green (all our runners are being used right now so it might be a bit)
Thanks for the speedy turnaround @GuySartorelli 🚀 |
Description
Given that this issue has been open for some time, we should update the documentation which is giving incorrect information to developers.
I have added an example of how best to manage
cascade_deletes
betweenmany_many
related objects.To avoid adding confusion, I decided against adding the alternative solution using
onBeforeDelete()
andremoveAll()
. However this can also be added if you think it is needed, or better?Issues
Pull request checklist