Remove validations

This commit is contained in:
Ritchie 2013-07-25 11:06:06 -07:00
parent afa5edd357
commit 371a6341b9
1 changed files with 0 additions and 18 deletions

View File

@ -1,18 +0,0 @@
# loopback-data-validations
Built-in validators, creating custom validations, syncronous and asyncronous object validation.
// Setup validations
User.validatesPresenceOf('name', 'email')
User.validatesLengthOf('password', {min: 5, message: {min: 'Password is too short'}});
User.validatesInclusionOf('gender', {in: ['male', 'female']});
User.validatesExclusionOf('domain', {in: ['www', 'billing', 'admin']});
User.validatesNumericalityOf('age', {int: true});
User.validatesUniquenessOf('email', {message: 'email is not unique'});
user.isValid(function (valid) {
if (!valid) {
user.errors // hash of errors {attr: [errmessage, errmessage, ...], attr: ...}
}
})