diff --git a/lib/persisted-model.js b/lib/persisted-model.js index b33a0cb0..90a5c861 100644 --- a/lib/persisted-model.js +++ b/lib/persisted-model.js @@ -1362,7 +1362,9 @@ function rectifyOnSave(ctx, next) { } function rectifyOnDelete(ctx, next) { - var id = getIdFromWhereByModelId(ctx.Model, ctx.where); + var id = ctx.instance ? ctx.instance.getId() : + getIdFromWhereByModelId(ctx.Model, ctx.where); + if (id) { ctx.Model.rectifyChange(id, reportErrorAndNext); } else {