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

You need to sign in or sign up before continuing.
Commit 79c6ac40 by sdepold

removed unnecessary event emitter + refactoring

1 parent 6a1e4a9b
Showing with 7 additions and 11 deletions
......@@ -102,21 +102,17 @@ module.exports = (function() {
Sequelize.prototype.sync = function(options) {
options = options || {}
if(this.options.sync)
if(this.options.sync) {
options = Sequelize.Utils.merge(options, this.options.sync)
}
var self = this
return new Utils.CustomEventEmitter(function(emitter) {
var chainer = new Utils.QueryChainer
var chainer = new Utils.QueryChainer()
self.daoFactoryManager.daos.forEach(function(dao) { chainer.add(dao.sync(options)) })
this.daoFactoryManager.daos.forEach(function(dao) {
chainer.add(dao.sync(options))
})
chainer
.run()
.success(function() { emitter.emit('success', null) })
.error(function(err) { emitter.emit('error', err) })
}).run()
return chainer.run()
}
Sequelize.prototype.drop = function() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!