This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('mongoose'); | |
var async = require('async'); | |
// Mongoose 4.x+ doesn't actually call any Schema hooks added after | |
// a Model is created from that schema, so we do some patching to | |
// get that to occur. This is incredibly unfortunate. | |
// There is an assumption that the Model's schema will not be used | |
// to power any other models. | |
var events = ['save', 'remove']; |