From 000c380a486678fba04410da1e8237ff2982ecd9 Mon Sep 17 00:00:00 2001 From: Jaka Hudoklin Date: Fri, 22 Aug 2014 16:02:01 +0200 Subject: [PATCH] Emit deleted event on delete for embedsMany relations Signed-off-by: Jaka Hudoklin --- lib/relation-definition.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/relation-definition.js b/lib/relation-definition.js index b224faad..fe7f1d81 100644 --- a/lib/relation-definition.js +++ b/lib/relation-definition.js @@ -2107,6 +2107,7 @@ EmbedsMany.prototype.destroyById = function (fkId, cb) { modelInstance.updateAttribute(propertyName, embeddedList, function(err) { cb(err); + modelTo.emit('deleted', inst.id, inst.toJSON()); }); } } else if (typeof cb === 'function') {