Skip to content

Commit

Permalink
feat(update): update when has SET clause
Browse files Browse the repository at this point in the history
  • Loading branch information
tr1v3r committed Nov 9, 2021
1 parent 5daa413 commit 33bc56c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion callbacks/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func Update(config *Config) func(db *gorm.DB) {
db.Statement.AddClauseIfNotExists(clause.Update{})
if set := ConvertToAssignments(db.Statement); len(set) != 0 {
db.Statement.AddClause(set)
} else {
} else if _, ok := db.Statement.Clauses["SET"]; !ok {
return
}
db.Statement.Build(db.Statement.BuildClauses...)
Expand Down

0 comments on commit 33bc56c

Please sign in to comment.