diff --git a/lib/validation/validators.go b/lib/validation/validators.go index 72388fc..d2e06b0 100644 --- a/lib/validation/validators.go +++ b/lib/validation/validators.go @@ -160,7 +160,7 @@ func uniqueValidator(match []string, value *generic.Value, stmt *gorm.Statement, } func foreignKeyValidator(match []string, value *generic.Value, stmt *gorm.Statement, field *schema.Field) error { - if field.StructField.Type.Kind() == reflect.Ptr && value.String() == "" { + if field.StructField.Type.Kind() == reflect.Ptr && value.String() == "" && value.String() == "" { return nil } var c int64