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

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() { ...@@ -270,17 +270,17 @@ module.exports = (function() {
} }
var findAutoIncrementField = function() { var findAutoIncrementField = function() {
var self = this var fields = this.QueryGenerator.findAutoIncrementField(this)
, fields = this.QueryGenerator.findAutoIncrementField(this)
this.autoIncrementField = null this.autoIncrementField = null
fields.forEach(function(field) { fields.forEach(function(field) {
if(self.autoIncrementField) if (this.autoIncrementField) {
throw new Error('Invalid DAO definition. Only one autoincrement field allowed.') throw new Error('Invalid DAO definition. Only one autoincrement field allowed.')
else } else {
self.autoIncrementField = field this.autoIncrementField = field
}) }
}.bind(this))
} }
Utils._.extend(DAOFactory.prototype, require("./associations/mixin")) 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!