-
-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Labels
Description
INtroduce a new key called this.constraintProfiles which is a struct of arrays/lists. Each key is the name of the profile and it's value can be an array or list of fields. This is useful to define all global constraints but actually validate using a profile only.
this.constraintProfiles = {
new = [ "fname", "lname", "email", "password" ],
update = "fname,lname,email",
passUpdate = "password,confirmpassword"
}
Then when calling validation you use the profiles argument
var results = validateModel( target=model, profiles="update" )
Or you can pass multiple profiles
var results = validateModel( target=model, profiles="update,passUpdate" )
Reactions are currently unavailable