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

Commit 9a59b63e by Sascha Depold

removed overengineering

1 parent 19d18ae6
Showing with 3 additions and 6 deletions
...@@ -446,9 +446,8 @@ module.exports = (function() { ...@@ -446,9 +446,8 @@ module.exports = (function() {
QueryInterface.prototype.insert = function(dao, tableName, values, options) { QueryInterface.prototype.insert = function(dao, tableName, values, options) {
var sql = this.QueryGenerator.insertQuery(tableName, values, dao.daoFactory.rawAttributes) var sql = this.QueryGenerator.insertQuery(tableName, values, dao.daoFactory.rawAttributes)
return queryAndEmit.call(this, [sql, dao], 'insert', { return queryAndEmit.call(this, [sql, dao, options], 'insert', {
success: function(obj) { obj.isNewRecord = false }, success: function(obj) { obj.isNewRecord = false }
transaction: (options || {}).transaction
}) })
} }
...@@ -887,11 +886,9 @@ module.exports = (function() { ...@@ -887,11 +886,9 @@ module.exports = (function() {
sqlOrQueryParams.push({}) sqlOrQueryParams.push({})
} }
sqlOrQueryParams[2].transaction = options.transaction
emitter.query = this.sequelize.query.apply(this.sequelize, sqlOrQueryParams) emitter.query = this.sequelize.query.apply(this.sequelize, sqlOrQueryParams)
} else { } else {
emitter.query = this.sequelize.query(sqlOrQueryParams, null, { transaction: options.transaction }) emitter.query = this.sequelize.query(sqlOrQueryParams, null, { })
} }
emitter emitter
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!