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

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() { ...@@ -102,21 +102,17 @@ module.exports = (function() {
Sequelize.prototype.sync = function(options) { Sequelize.prototype.sync = function(options) {
options = options || {} options = options || {}
if(this.options.sync) if(this.options.sync) {
options = Sequelize.Utils.merge(options, this.options.sync) options = Sequelize.Utils.merge(options, this.options.sync)
}
var self = this var chainer = new Utils.QueryChainer()
return new Utils.CustomEventEmitter(function(emitter) {
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 return chainer.run()
.run()
.success(function() { emitter.emit('success', null) })
.error(function(err) { emitter.emit('error', err) })
}).run()
} }
Sequelize.prototype.drop = function() { 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!