Skip to content

Commit

Permalink
fix unique validator
Browse files Browse the repository at this point in the history
  • Loading branch information
iesreza committed Jun 10, 2024
1 parent 853dd4e commit f51ff88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/validation/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func uniqueValidator(match []string, value *generic.Value, stmt *gorm.Statement,
if !zero {
model = model.Where(stmt.Schema.PrioritizedPrimaryField.DBName+" != ?", of)
}
model.Count(&c)
model.Debug().Count(&c)
if c > 0 {
return fmt.Errorf("duplicate entry")
}
Expand Down

0 comments on commit f51ff88

Please sign in to comment.