Skip to content

Commit

Permalink
Added post-creation plugin hook for Instances
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Dec 11, 2013
1 parent b05c566 commit 4f8384e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4f8384e

Please sign in to comment.