I need to write Domain class constraint in Grails which says that one integer field must be greater or equal than the other.
When I write the code like this:
class MyDomain {
String title
int valueMin = 1
int valueMax = 1
static constraints = {
valueMin(min:1)
valueMax(min:valueMin)
}
}
I'm getting error:
Caused by: groovy.lang.MissingPropertyException: No such property: valueMin for class: MyDomain
Any idea, please?