sequelize/sequelize — pull request #580 by interlock (2013-05-01 16:40:05+00:00)
Title: Async validation

This is an updated pull request for issue #275.

This PR actually breaks existing implementations, because we had to use promises as the return result. As a result, I suggest we create a 2.0 branch that implements this and other changes which may regress for people.

Docs would need to be updated for this update (if accepted in 2.0 branch, will provide this update).

Custom validators need to call ```next()``` or ```next(error_message)``` to operate correctly now.

model->validate() returns a promise, use like so
```
user.validate().success( function() {
user.save();
}).error(function(errors) {
// handle errors
});
```

Once accepted, it would be fairly easy to adjust a models save to call validate before save as well. There are a few PR's for that as well.