-
class Validators {
-
-
static final confirmPasswordValidator = { value, command ->
-
if (command. password != command. confirmPassword ) {
-
return 'command.confirmPassword.error.mismatch'
-
}
-
}
-
-
static def requiresAtleastOne = {val, obj ->
-
if ( !val ?. size ( ) ) {
-
return "default.requires.atleast.one"
-
}
-
}
-
}
-
-
-
class MyDomain {
-
...
-
static constraints = {
-
items (validator: requiresAtleastOne )
-
}
-
}
create a new version of this pasteRAW Paste Data