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

Commit f23b4dee by Sascha Depold

bind this to function and don't use additional self variable

1 parent c2d29dbe
Showing with 6 additions and 6 deletions
......@@ -270,17 +270,17 @@ module.exports = (function() {
}
var findAutoIncrementField = function() {
var self = this
, fields = this.QueryGenerator.findAutoIncrementField(this)
var fields = this.QueryGenerator.findAutoIncrementField(this)
this.autoIncrementField = null
fields.forEach(function(field) {
if(self.autoIncrementField)
if (this.autoIncrementField) {
throw new Error('Invalid DAO definition. Only one autoincrement field allowed.')
else
self.autoIncrementField = field
})
} else {
this.autoIncrementField = field
}
}.bind(this))
}
Utils._.extend(DAOFactory.prototype, require("./associations/mixin"))
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!