github.com/tsmith1024/pop@v4.12.2+incompatible/genny/model/_fixtures/models/widget_empty.go (about) 1 package models 2 3 import ( 4 "encoding/json" 5 6 "github.com/gobuffalo/pop" 7 "github.com/gobuffalo/validate" 8 ) 9 10 type Widget struct { 11 } 12 13 // String is not required by pop and may be deleted 14 func (w Widget) String() string { 15 jw, _ := json.Marshal(w) 16 return string(jw) 17 } 18 19 // Widgets is not required by pop and may be deleted 20 type Widgets []Widget 21 22 // String is not required by pop and may be deleted 23 func (w Widgets) String() string { 24 jw, _ := json.Marshal(w) 25 return string(jw) 26 } 27 28 // Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. 29 // This method is not required and may be deleted. 30 func (w *Widget) Validate(tx *pop.Connection) (*validate.Errors, error) { 31 return validate.NewErrors(), nil 32 } 33 34 // ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. 35 // This method is not required and may be deleted. 36 func (w *Widget) ValidateCreate(tx *pop.Connection) (*validate.Errors, error) { 37 return validate.NewErrors(), nil 38 } 39 40 // ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. 41 // This method is not required and may be deleted. 42 func (w *Widget) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error) { 43 return validate.NewErrors(), nil 44 }