Return valid in case of sync validations

This commit is contained in:
Anatoliy Chakkaev 2013-04-01 20:13:55 +04:00
parent c5019ef354
commit be17763eca
2 changed files with 3 additions and 1 deletions

View File

@ -400,6 +400,8 @@ Validatable.prototype.isValid = function (callback, data) {
// in case of async validation we should return undefined here,
// because not all validations are finished yet
return;
} else {
return valid;
}
};

View File

@ -60,7 +60,7 @@ describe('validations', function() {
});
describe.only('lifecycle', function() {
describe('lifecycle', function() {
it('should work on create', function(done) {
User.validatesPresenceOf('name');