I would say that, as mentioned, there is a way to display the affected entries to the user, then there are two buttons / links, one of which is deleted, possibly with confirmation for the user who asks if they checked the other link, which is a list of all records that they will influence.
Then, if you want to be sure that you can also do a soft deletion by marking them as deleted in the database, rather than deleting them, which may come in handy, I donβt know how you can handle this automatic dependent deletion, possibly with act_as_paranoid or some kind of self-catalyzed version with a parent model callback.
source share