Skip to content

Commit

Permalink
use WhereID instead 'id = ?'
Browse files Browse the repository at this point in the history
  • Loading branch information
sio4 committed Sep 24, 2022
1 parent 031495d commit ec95bc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion executors.go
Expand Up @@ -274,7 +274,7 @@ func (c *Connection) Create(model interface{}, excludeColumns ...string) error {
return c.Create(m.Value)
}

exists, errE := Q(c).Where("id = ?", id).Exists(i)
exists, errE := Q(c).Where(m.WhereID(), id).Exists(i)
if errE != nil || !exists {
return c.Create(m.Value)
}
Expand Down

0 comments on commit ec95bc4

Please sign in to comment.