What setup is required for Validation via the ValidationDAODecorator?
Our validateObj(s) are called. Not sure how to cause put to reject. It's my impression that validateObject() is meant to validate the complete object not just a single property as with validateObj but I'm not sure what method in my model I should implement to work with validateoObject.
Thanks
Joel
We are wrapping our DAO(s) with
if (info.validate) {
var decorated = this.DecoratedDAO.create({
decorator: this.ValidationDAODecorator.create({
dao: dao
}, this),
delegate: dao
}, this);
dao = decorated;
}
and we have validateObj
{
name: "email",
class: 'String',
required: true,
validateObj: function(email) {
// TODO: proper email regex
return email.length > 3;
}
},