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

Commit 1f720828 by Sascha Depold

fixed scoping of validation

1 parent 67e713f3
Showing with 17 additions and 10 deletions
...@@ -675,16 +675,23 @@ module.exports = (function() { ...@@ -675,16 +675,23 @@ module.exports = (function() {
return new Utils.CustomEventEmitter(function(emitter) { return new Utils.CustomEventEmitter(function(emitter) {
if (options.validate === true) { if (options.validate === true) {
this.build(attrValueHash).validate().success(function(errors) { var build = this.build(attrValueHash)
if (!!errors) { , attrKeys = Object.keys(attrValueHash)
emitter.emit('error', errors)
} else { build
this .validate({
.QueryInterface skip: Object.keys(build.dataValues).filter(function(val) { return attrKeys.indexOf(val) !== -1 })
.bulkUpdate(this.tableName, attrValueHash, where, options) })
.proxy(emitter) .success(function(errors) {
} if (!!errors) {
}.bind(this)) emitter.emit('error', errors)
} else {
this
.QueryInterface
.bulkUpdate(this.tableName, attrValueHash, where, options)
.proxy(emitter)
}
}.bind(this))
} else { } else {
this this
.QueryInterface .QueryInterface
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!