Skip to content

Use `delete_all` instead of `destroy` when deleting events

The following discussion from gitlab-ee!15649 should be addressed:

  • @jprovaznik started a discussion:

    In this case we can't rely on DB constraint and we have to add dependent: ... because it's a polymorphic association.

    Surprisingly other eventable resources use dependent: :destroy which I think is not necessary because we don't use any callbacks on Event model. So perhaps these should be changed to delete_all to in a follow-up.