The (implicit) return value of a beforeUpdate closure prevents updates. Maybe there is a reason for that, but then beforeInsert should be treated as well. And both should be documented!
Testcase
--------
0. create a new grails app
1. create the following domain class
class UpdateBlocker {
String password
def encode = {
return false // if commented updates will work
}
def beforeInsert = encode
def beforeUpdate = encode
}
2. generate-all UpdateBlocker
3. run-app
4. create a new UpdateBlocker instance with some "test" in the password field.
5. edit the instance and set password to "changed".
If you view the instance you should see "changed" in the password field, but you will see "test"! If the only line in the closure is commented, it will work as expected.
This is by design, returning false signfies that he operation should be aborted