-
Notifications
You must be signed in to change notification settings - Fork 61
Dynmic Finder
Robert Oschwald edited this page Sep 18, 2015
·
4 revisions
- Add "import org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEvent" to the domain class.
- Add the following code to the domain class to specify the getChanges method:
List getChanges() {
AuditLogEvent.findAllByClassNameAndPersistedObjectId(
this.getClass().getName(), this.id)
}
- Add to your Controller:
def show = {
def domainInst = YourDomain.get(params.id)
def domainChanges = domainInst.getChanges()
return [domainInst: domainInst, domainChanges:domainChanges]
}
- Add apropriate views for the new Controller class to query the audit log for the changes and to list them.