2
我寻求这种性质如何在不保存nodejs |的情况下验证记录sailsjs |水线
//validation rules in model "User"
attributes: {
age: {
required: true,
type: 'numeric'
}
},
//now in controller, i want to be able to do this
Recipe.validate({age: 'An invalid age because it is a string. I except a validation error as response'});
问题是,这是行不通的东西..它抱怨不是可用beforeValidate等
难道你不能建立一个食谱实例,并且根本就不调用它的保存函数吗? – 2014-09-13 16:25:14