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

Commit 915e5d5e by sdepold

use helper

1 parent 9386e219
Showing with 2 additions and 10 deletions
...@@ -161,7 +161,6 @@ module.exports = (function() { ...@@ -161,7 +161,6 @@ module.exports = (function() {
QueryInterface.prototype.insert = function(model, tableName, values) { QueryInterface.prototype.insert = function(model, tableName, values) {
var sql = this.QueryGenerator.insertQuery(tableName, values) var sql = this.QueryGenerator.insertQuery(tableName, values)
return queryAndEmit.call(this, [sql, model], 'insert', { return queryAndEmit.call(this, [sql, model], 'insert', {
success: function(obj) { obj.isNewRecord = false } success: function(obj) { obj.isNewRecord = false }
}) })
...@@ -178,15 +177,8 @@ module.exports = (function() { ...@@ -178,15 +177,8 @@ module.exports = (function() {
} }
QueryInterface.prototype.select = function(factory, tableName, options, queryOptions) { QueryInterface.prototype.select = function(factory, tableName, options, queryOptions) {
var sql = this.QueryGenerator.selectQuery(tableName, options) var sql = this.QueryGenerator.selectQuery(tableName, options)
, _query = query.call(this, sql, factory, queryOptions) return queryAndEmit.call(this, [sql, factory, queryOptions], 'select')
, self = this
_query
.success(function(){ self.emit('select', null) })
.error(function(err){ self.emit('select', err)})
return _query
} }
QueryInterface.prototype.rawSelect = function(tableName, options, attributeSelector) { QueryInterface.prototype.rawSelect = function(tableName, options, attributeSelector) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!