summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2017-02-26 10:10:16 +0200
committerLauri Ojansivu <x@xet7.org>2017-02-26 10:10:16 +0200
commit7f978ea67748908135198fea7c7ca97c89495b78 (patch)
tree1f6d346980fcdd3cc944cd302a139da45143cc63
parent29fdfb9c886f1a906a27398fd546ad6cdb929ff9 (diff)
parent06699007c416372b93cd4ac58e6c085375c792ee (diff)
downloadwekan-7f978ea67748908135198fea7c7ca97c89495b78.tar.gz
wekan-7f978ea67748908135198fea7c7ca97c89495b78.tar.bz2
wekan-7f978ea67748908135198fea7c7ca97c89495b78.zip
Merge branch 'maulal-devel' into devel
Fix Bug: orphan documents were created when cards were deleted
-rw-r--r--models/cards.js10
1 files changed, 10 insertions, 0 deletions
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,
+ });
});
}