Closed sas1024 closed 6 years ago
It's need to prevent to write update log if fields in struct was not updated.
For now gorm:after_update callback is used for handling updates. If there is no updated fields in loggable struct, gorm will update updatedAt field.
gorm:after_update
updatedAt
Loggable must skip these update events, if no updates in struct fields
Loggable write update event to database. And there is only one changed field - updatedAt.
-- May be gorm:before_update callback will help to solve this issue.
gorm:before_update
It's need to prevent to write update log if fields in struct was not updated.
For now
gorm:after_update
callback is used for handling updates. If there is no updated fields in loggable struct, gorm will updateupdatedAt
field.What did I expect to see?
Loggable must skip these update events, if no updates in struct fields
What did I see instead?
Loggable write update event to database. And there is only one changed field - updatedAt.
-- May be
gorm:before_update
callback will help to solve this issue.