不要怂,就是干,撸起袖子干!

Commit 08c32bc8 by sdepold

store importCache in sequelize instance

1 parent 7331aab5
Showing with 6 additions and 4 deletions
......@@ -41,6 +41,8 @@ module.exports = (function() {
this.daoFactoryManager = new DAOFactoryManager(this)
this.connectorManager = new ConnectorManager(this, this.config)
this.importCache = {}
}
Sequelize.Utils = Utils
......@@ -73,13 +75,13 @@ module.exports = (function() {
return factory
}
var importCache = {};
Sequelize.prototype.import = function(path) {
if (!importCache[path]) {
if (!this.importCache[path]) {
var defineCall = require(path)
importCache[path] = defineCall(this, DataTypes)
this.importCache[path] = defineCall(this, DataTypes)
}
return importCache[path];
return this.importCache[path]
}
Sequelize.prototype.migrate = function(options) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!