In our Grails 2.2.3 application, we add event processing methods to all classes in the domain, adding the following to metaclasses in BootStrap.groovy init:
for(gc in grailsApplication.domainClasses) {
gc.metaClass.beforeInsert = {
}
gc.metaClass.beforeUpdate = {
}
}
(as inspired by this post: qaru.site/questions/2110555 / ... )
This works fine in 2.2.3, but no longer works after upgrading to 2.3.5. Methods are added to metaclasses, but never called. From the documentation, it does not look like these event methods have been deleted or changed or anything else. Is there any other way to do this that will work in version 2.3.5?
source
share