From 06699007c416372b93cd4ac58e6c085375c792ee Mon Sep 17 00:00:00 2001 From: maulal Date: Sat, 25 Feb 2017 02:16:00 +0100 Subject: Bug: orphan documents were created when cards were deleted --- models/cards.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'models') diff --git a/models/cards.js b/models/cards.js index 9c149e51..922fbecd 100644 --- a/models/cards.js +++ b/models/cards.js @@ -354,9 +354,19 @@ if (Meteor.isServer) { }); // Remove all activities associated with a card if we remove the card + // Remove also card_comments / checklists / attachments Cards.after.remove((userId, doc) => { Activities.remove({ cardId: doc._id, }); + Checklists.remove({ + cardId: doc._id, + }); + CardComments.remove({ + cardId: doc._id, + }); + Attachments.remove({ + cardId: doc._id, + }); }); } -- cgit v1.2.3-1-g7c22