mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
parent
865366c7c8
commit
1e90126760
1 changed files with 9 additions and 0 deletions
|
@ -396,6 +396,15 @@ ghostBookshelf.Model = ghostBookshelf.Model.extend({
|
|||
},
|
||||
|
||||
onDestroyed(model, options) {
|
||||
if (!model._changed) {
|
||||
model._changed = {};
|
||||
}
|
||||
|
||||
// @NOTE: Bookshelf destroys ".changed" right after this event, but we should not throw away the information
|
||||
// It is useful for webhooks, events etc.
|
||||
// @NOTE: Bookshelf returns ".changed = {empty...}" on destroying (https://github.com/bookshelf/bookshelf/issues/1943)
|
||||
Object.assign(model._changed, _.cloneDeep(model.changed));
|
||||
|
||||
addAction(model, 'deleted', options);
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue