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

Commit 1f720828 by Sascha Depold

fixed scoping of validation

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