Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement