fix: call manage_relationships in single hard destroy path#2596
Merged
zachdaniel merged 2 commits intomainfrom Feb 27, 2026
Merged
fix: call manage_relationships in single hard destroy path#2596zachdaniel merged 2 commits intomainfrom
zachdaniel merged 2 commits intomainfrom
Conversation
The single hard destroy path in `destroy.ex` never called `manage_relationships`, causing any `manage_relationship` changes declared on hard destroy actions to be silently ignored. The bulk destroy, soft destroy, create, and update paths all properly called `manage_relationships`. Adds `manage_relationships/4` to `Ash.Actions.Destroy` following the same pattern used in `Ash.Actions.Update`, and pipes the data layer result through it before the notification/select pipeline. Also adds comprehensive tests for manage_relationship on destroy actions: single hard destroy, single soft destroy, bulk hard destroy, and bulk soft destroy. Closes ash-project/ash_postgres#702
zachdaniel
approved these changes
Feb 27, 2026
Contributor
|
🚀 Thank you for your contribution! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
manage_relationshipchanges — thecommit/3function indestroy.exnever calledmanage_relationships, unlike create, update, soft destroy, and bulk destroy pathsmanage_relationships/4toAsh.Actions.Destroyfollowing the same pattern fromAsh.Actions.Update(lines 728-757)manage_relationshipsbefore the notification/select pipeline, and propagates relationship notifications instead of hardcoding[]Test plan
bulk_manage_relationship_rollback_test.exs— 20/20 pass with local ashRelated: ash-project/ash_postgres#702