Reputation: 7335
I'm hoping this just needs a new pair of eyes casting over it.
I have a school class
class School {
String name
static constraints = {
name(maxLength:50,blank:false)
}
static hasMany = [pupils:Reviewer]
String toString() {
return name
}
}
I have a School controller
class SchoolController {
def scaffold = School
}
When I run the app and put a very long ( much longer than 50 than 50 char ) or even a blank name into my add school form, the constraints don't seem to be obeyed.
What am I missing?
Dave
Upvotes: 2
Views: 366
Reputation: 11637
According to the Grails Validation Reference maxLength is deprecated..
Have you tried using maxSize instead?
Upvotes: 8