Skip to content

Commit

Permalink
fix: model not complete in beforeUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
段孔乐 committed Sep 13, 2023
1 parent 9a314e0 commit fcc9ba2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions query_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,17 +459,17 @@ func (q *UpdateQuery) scanOrExec(
return nil, q.err
}

// Run append model hooks before generating the query.
if err := q.beforeAppendModel(ctx, q); err != nil {
return nil, err
}

if q.table != nil {
if err := q.beforeUpdateHook(ctx); err != nil {
return nil, err
}
}

// Run append model hooks before generating the query.
if err := q.beforeAppendModel(ctx, q); err != nil {
return nil, err
}

// Generate the query before checking hasReturning.
queryBytes, err := q.AppendQuery(q.db.fmter, q.db.makeQueryBytes())
if err != nil {
Expand Down

0 comments on commit fcc9ba2

Please sign in to comment.