thanks Victor Sergienko, but I'm modifying your code a bit
class Bid {
Double amount
...
static constraints = { amount(validator: { double a, Bid b ->
Bid tempBid = Bid.get(b.id)
def oldValue = tempBid.getPersistentValue('amount')
a > oldValue + 0.5 ? true : "Amount $a should be at least ${oldValue + 0.5}" })
}
}
The difference in this line is:
Bid tempBid = Bid.get(b.id)
def oldValue = tempBid.getPersistentValue('amount')
, b.getPersistentValue('amount') null, grails - 2.4.3