James Myers
12/21/2021, 3:01 PMval updatedAt = datetime("updated_at").defaultExpression(CurrentDateTime())
I was looking at the following chunk for using the EntityHook and it wasn’t clear how to leverage the CurrentDateTime here as well:
EntityHook.subscribe { action ->
if (action.changeType == EntityChangeType.Updated) {
action.toEntity(this)?.updatedAt = LocalDateTime.now(Clock.systemUTC())
}
}
I’ve tried looking through the code/docs but wasn’t able to find an example of how to do this properly. Is there something obvious that I’m missing here, or do these two not work very well together. Any help would be appreciated. Thanks!dave08
12/21/2021, 3:59 PMdave08
12/21/2021, 4:00 PMJames Myers
12/22/2021, 3:27 PM