Merge pull request #1238 from strongloop/fix/change-tracking-on-delete

Use `ctx.instance` provided by "after delete" hook
This commit is contained in:
Miroslav Bajtoš 2015-03-24 11:06:55 +01:00
commit df770455eb
1 changed files with 3 additions and 1 deletions

View File

@ -1362,7 +1362,9 @@ function rectifyOnSave(ctx, next) {
} }
function rectifyOnDelete(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) { if (id) {
ctx.Model.rectifyChange(id, reportErrorAndNext); ctx.Model.rectifyChange(id, reportErrorAndNext);
} else { } else {