code:static constraints = {
titleStr size:1..120
categoryStr nullable: false,inList:['For Sale', 'For Rent']
}
when categoryStr is For rent ,it will return error
code: static constraints = { titleStr size:1..120 categoryStr nullable: false,inList:[‘For Sale’, ‘For Rent’] }
Share
I would use a custom validator to do the case insensitive check: