def b = Book.get(1)
someMethodThatMightModifyTheInstance(b)
// when called without arguments returns true if any field was changed
if (b.isDirty()) {
// can also check if one field has changed
if (b.isDirty('title')) {
...
}
}
isDirty
Purpose
Checks to see if a domain class instance has been modified.
Examples
Description
Parameters:
-
fieldName
- The name of a field to check