mirror of https://github.com/go-gorm/gorm.git
delete unused callbacks/create.go
This commit is contained in:
parent
10fcb0c88e
commit
6775ecaf13
|
@ -1,21 +0,0 @@
|
||||||
package callbacks
|
|
||||||
|
|
||||||
import "github.com/jinzhu/gorm"
|
|
||||||
|
|
||||||
func Create(scope *gorm.Scope) {
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
gorm.DefaultCallback.Create().Before().Register(Create)
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
DefaultCallback.Create().Before("Delete").After("Lalala").Register("delete", Delete)
|
|
||||||
DefaultCallback.Update().Before("Delete").After("Lalala").Remove("replace", Delete)
|
|
||||||
DefaultCallback.Delete().Before("Delete").After("Lalala").Replace("replace", Delete)
|
|
||||||
DefaultCallback.Query().Before("Delete").After("Lalala").Replace("replace", Delete)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Scope
|
|
||||||
// HasError(), HasColumn(), CallMethod(), Raw(), Exec()
|
|
||||||
// TableName(), CombinedQuerySQL()
|
|
2
scope.go
2
scope.go
|
@ -86,8 +86,6 @@ func (scope *Scope) CallMethod(name string) {
|
||||||
} else {
|
} else {
|
||||||
scope.Err(errors.New(fmt.Sprintf("unsupported function %v", name)))
|
scope.Err(errors.New(fmt.Sprintf("unsupported function %v", name)))
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
scope.Err(errors.New(fmt.Sprintf("no valid function %v found", name)))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue