Open GoogleCodeExporter opened 8 years ago
Thanks for reporting, that's definitely a bug. Would you like to fix that
yourself and send a pull request? I'd highly appreciate it.
Cheers,
Martin
Original comment by krass...@googlemail.com
on 11 Aug 2012 at 7:54
[deleted comment]
[deleted comment]
I replaced the "update" method of the scaffolding template
"ResourceService.groovy" with the following:
def update(${resourceName} dto) {
def obj = ${resourceName}.get(dto.id)
if (obj.hasProperty('dateCreated')) { // preserve the initial dateCreated
def dc=obj.dateCreated
}
if (!obj) {
throw new DomainObjectNotFoundException(${resourceName}.class, dto.id)
}
obj.properties = dto.properties
if (obj.hasProperty('lastUpdated')) {obj.lastUpdated=new Date()}
if (obj.hasProperty('dateCreated')) {obj.dateCreated=dc}
obj
}
Original comment by ncaramol...@gmail.com
on 23 Jun 2013 at 8:45
Original issue reported on code.google.com by
mlim1...@gmail.com
on 10 Aug 2012 at 7:43