change update callback func name

This commit is contained in:
Aymen 2017-10-20 10:30:26 +01:00
parent 35d9fc7a31
commit aa7b10be29
2 changed files with 3 additions and 3 deletions

View File

@ -41,7 +41,7 @@ func beforeUpdateCallback(scope *Scope) {
scope.CallMethod("BeforeSave")
}
if !scope.HasError() {
scope.CallMethod("BeforeUpdate")
scope.CallMethod("GormBeforeUpdate")
}
}
}
@ -100,7 +100,7 @@ func updateCallback(scope *Scope) {
func afterUpdateCallback(scope *Scope) {
if _, ok := scope.Get("gorm:update_column"); !ok {
if !scope.HasError() {
scope.CallMethod("AfterUpdate")
scope.CallMethod("GormAfterUpdate")
}
if !scope.HasError() {
scope.CallMethod("AfterSave")

View File

@ -17,7 +17,7 @@ func (s *Product) BeforeCreate() (err error) {
return
}
func (s *Product) BeforeUpdate() (err error) {
func (s *Product) GormBeforeUpdate() (err error) {
if s.Code == "dont_update" {
err = errors.New("can't update")
}