Merge pull request #2691 from ken8203/bugfix/fix-typo-of-example-code

Fix typo of example code
This commit is contained in:
Emir Beganović 2019-10-08 12:04:52 +02:00 committed by GitHub
commit 1bca5dbdd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -119,8 +119,8 @@ func (cp *CallbackProcessor) Remove(callbackName string) {
// Replace a registered callback with new callback // Replace a registered callback with new callback
// db.Callback().Create().Replace("gorm:update_time_stamp_when_create", func(*Scope) { // db.Callback().Create().Replace("gorm:update_time_stamp_when_create", func(*Scope) {
// scope.SetColumn("Created", now) // scope.SetColumn("CreatedAt", now)
// scope.SetColumn("Updated", now) // scope.SetColumn("UpdatedAt", now)
// }) // })
func (cp *CallbackProcessor) Replace(callbackName string, callback func(scope *Scope)) { func (cp *CallbackProcessor) Replace(callbackName string, callback func(scope *Scope)) {
cp.logger.Print(fmt.Sprintf("[info] replacing callback `%v` from %v\n", callbackName, fileWithLineNum())) cp.logger.Print(fmt.Sprintf("[info] replacing callback `%v` from %v\n", callbackName, fileWithLineNum()))