| 13 | ) |
| 14 | |
| 15 | type 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 | |
| 31 | func (s *Product) BeforeCreate(tx *gorm.DB) (err error) { |
| 32 | if s.Code == "Invalid" { |
nothing calls this directly
no outgoing calls
no test coverage detected