MCPcopy
hub / github.com/go-gorm/gorm / Product

Struct Product

tests/hooks_test.go:15–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13)
14
15type Product struct {
16 gorm.Model
17 Name string
18 Code string
19 Price float64
20 AfterFindCallTimes int64
21 BeforeCreateCallTimes int64
22 AfterCreateCallTimes int64
23 BeforeUpdateCallTimes int64
24 AfterUpdateCallTimes int64
25 BeforeSaveCallTimes int64
26 AfterSaveCallTimes int64
27 BeforeDeleteCallTimes int64
28 AfterDeleteCallTimes int64
29}
30
31func (s *Product) BeforeCreate(tx *gorm.DB) (err error) {
32 if s.Code == "Invalid" {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected