MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / defaults

Method defaults

app/controlplane/pkg/data/ent/user_create.go:183–196  ·  view source on GitHub ↗

defaults sets the default values of the builder before save.

()

Source from the content-addressed store, hash-verified

181
182// defaults sets the default values of the builder before save.
183func (_c *UserCreate) defaults() {
184 if _, ok := _c.mutation.CreatedAt(); !ok {
185 v := user.DefaultCreatedAt()
186 _c.mutation.SetCreatedAt(v)
187 }
188 if _, ok := _c.mutation.UpdatedAt(); !ok {
189 v := user.DefaultUpdatedAt()
190 _c.mutation.SetUpdatedAt(v)
191 }
192 if _, ok := _c.mutation.ID(); !ok {
193 v := user.DefaultID()
194 _c.mutation.SetID(v)
195 }
196}
197
198// check runs all checks and user-defined validators on the builder.
199func (_c *UserCreate) check() error {

Callers 2

SaveMethod · 0.95
SaveMethod · 0.45

Calls 6

IDMethod · 0.65
CreatedAtMethod · 0.45
SetCreatedAtMethod · 0.45
UpdatedAtMethod · 0.45
SetUpdatedAtMethod · 0.45
SetIDMethod · 0.45

Tested by

no test coverage detected