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

Commit 7331aab5 by Sascha Depold

Merge pull request #199 from innofluence/importCache

Import cache
2 parents 68fdfc9c 2000687e
Showing with 6 additions and 2 deletions
......@@ -73,9 +73,13 @@ module.exports = (function() {
return factory
}
var importCache = {};
Sequelize.prototype.import = function(path) {
var defineCall = require(path)
return defineCall(this, DataTypes)
if (!importCache[path]) {
var defineCall = require(path)
importCache[path] = defineCall(this, DataTypes)
}
return 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!