Pretty sure you'll have to write a custom validator for that. I'm
relatively certain this won't work, but it should send you on the right
path:
static constraints = {
name(blank: false, validator: { val, obj ->
return ( MyDomain.getByNameIlike(val)?.id == obj.id )
}
}
-----Original Message-----
From: NiJK [mailto:
[hidden email]]
Sent: Wednesday, September 24, 2008 3:31 AM
To:
[hidden email]
Subject: [grails-user] Case Insensitive Constraint
Hi,
I have the following constraints in one of my domain classes
static constraints = {
name(blank:false,unique:true)
description(nullable:true)
}
which works fine except that I'd like the name to be case insensitive so
that names like "Example" and "example" would not be allowed.
Is there a quick and easy way to do that?
Nick.
--
View this message in context:
http://www.nabble.com/Case-Insensitive-Constraint-tp19646071p19646071.html
Sent from the grails - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email