Fix validateUniqueness/nextTick

This commit is contained in:
Fabien Franzen 2014-07-11 23:55:15 +02:00
parent 50656b8206
commit 61f6d49518
1 changed files with 3 additions and 1 deletions

View File

@ -328,7 +328,9 @@ function validateCustom(attr, conf, err, done) {
* Uniqueness validator
*/
function validateUniqueness(attr, conf, err, done) {
if (blank(this[attr])) return done();
if (blank(this[attr])) {
return process.nextTick(done);
}
var cond = {where: {}};
cond.where[attr] = this[attr];