I want to save my domain class to the database without specifying the createdUser
or createdDate
. I’ve created an object called AuditingInfo<
You can apply your metaClass modifications from within your Bootstrap.groovy, which is executed at start-up.
agree with doelleri
just add your code :
application.domainClasses.each { org.codehaus.groovy.grails.commons.GrailsDomainClass gc ->
gc.metaClass.beforeInsert = {
}
gc.metaClass.beforeUpdate = {
}
}
Into BootStrap.groovy