I am developing a grails application, I have domain classes like Tip, TipTag. Concept is, For a Tip I should have only 5 TipTag.
class Tip {
String description
static hasMany = [tags:TipTag]
static constraints = {
description(nullable:false,size:50..500)
}
}
How to restrict this in grails??
Any other way of doing this???
The maxSize constraint should do the job for you: