You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
validations: {name: db.enforce.notEmptyString('Oops! Your cluster needs a name.'),name: db.enforce.unique({ignoreCase : true},'Oops! Cluster with that name already exist.')}
It seems the only thing you are checking is uniqueness, not length because you are passing an object, not an array, so only the last validation will be applied as keys can't repeat in an object definition. If you would like two validators for the same field, please see the doco here: https://github.com/dresende/node-orm2/wiki/Model-Validations
Activity
dxg commentedon Jun 25, 2018
It seems the only thing you are checking is uniqueness, not length because you are passing an object, not an array, so only the last validation will be applied as keys can't repeat in an object definition. If you would like two validators for the same field, please see the doco here: https://github.com/dresende/node-orm2/wiki/Model-Validations