diff --git a/lib/Instance.js b/lib/Instance.js index 5b27d45..95bd90b 100644 --- a/lib/Instance.js +++ b/lib/Instance.js @@ -226,6 +226,10 @@ function Instance(model, doc, isNew) { }, enumerable: false }); + + for(var i = 0; i < model.database.plugins.length; i++) + if(model.database.plugins[i].newInstance) + model.database.plugins[i].newInstance.call(this, model, doc, isNew); } var diffPatch = Instance.diff = function (oldDoc, newDoc, path) {