mirror of https://github.com/go-gorm/gorm.git
Update two more places
This commit is contained in:
parent
8b127471f1
commit
bb3c74467d
|
@ -123,7 +123,7 @@ func (cp *CallbackProcessor) Remove(callbackName string) {
|
||||||
// scope.SetColumn("Updated", now)
|
// scope.SetColumn("Updated", now)
|
||||||
// })
|
// })
|
||||||
func (cp *CallbackProcessor) Replace(callbackName string, callback func(scope *Scope)) {
|
func (cp *CallbackProcessor) Replace(callbackName string, callback func(scope *Scope)) {
|
||||||
log.Printf("[info] replacing callback `%v` from %v\n", callbackName, fileWithLineNum())
|
cp.logger.Printf("[info] replacing callback `%v` from %v\n", callbackName, fileWithLineNum())
|
||||||
cp.name = callbackName
|
cp.name = callbackName
|
||||||
cp.processor = &callback
|
cp.processor = &callback
|
||||||
cp.replace = true
|
cp.replace = true
|
||||||
|
@ -162,7 +162,7 @@ func sortProcessors(cps []*CallbackProcessor) []*func(scope *Scope) {
|
||||||
for _, cp := range cps {
|
for _, cp := range cps {
|
||||||
// show warning message the callback name already exists
|
// show warning message the callback name already exists
|
||||||
if index := getRIndex(allNames, cp.name); index > -1 && !cp.replace && !cp.remove {
|
if index := getRIndex(allNames, cp.name); index > -1 && !cp.replace && !cp.remove {
|
||||||
log.Printf("[warning] duplicated callback `%v` from %v\n", cp.name, fileWithLineNum())
|
cp.logger.Printf("[warning] duplicated callback `%v` from %v\n", cp.name, fileWithLineNum())
|
||||||
}
|
}
|
||||||
allNames = append(allNames, cp.name)
|
allNames = append(allNames, cp.name)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue