mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: use a set when tracking cleared fields in mutation template
Signed-off-by: Alex Snast <alexsn@fb.com>
This commit is contained in:
@@ -84,8 +84,8 @@ func (nc *NodeCreate) Save(ctx context.Context) (*Node, error) {
|
||||
node, err = nc.sqlSave(ctx)
|
||||
return node, err
|
||||
})
|
||||
for i := len(nc.hooks); i > 0; i-- {
|
||||
mut = nc.hooks[i-1](mut)
|
||||
for i := len(nc.hooks) - 1; i >= 0; i-- {
|
||||
mut = nc.hooks[i](mut)
|
||||
}
|
||||
if _, err := mut.Mutate(ctx, nc.mutation); err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user