@@ -277,23 +277,23 @@ func TestClauseAssociationSetUpdateWithOpUnlink(t *testing.T) {
277277 }
278278}
279279
280- // Test Set + Update with Association OpCreateValues operation using real database
280+ // Test Set + Update with Association OpCreate operation using real database
281281func TestClauseAssociationSetUpdateWithOpCreateValues (t * testing.T ) {
282282 ctx := context .Background ()
283283
284284 // Create a user first using real database
285- user := User {Name : "TestClauseAssociationSetUpdateWithOpCreateValues " , Age : 25 }
285+ user := User {Name : "TestClauseAssociationSetUpdateWithOpCreate " , Age : 25 }
286286 if err := DB .Create (& user ).Error ; err != nil {
287287 t .Fatalf ("failed to create user: %v" , err )
288288 }
289289
290290 // Create a pet object
291291 newPet := Pet {Name : "created-pet" }
292292
293- // Test Set + Update with Association OpCreateValues
293+ // Test Set + Update with Association OpCreate
294294 assocOp := clause.Association {
295295 Association : "Pets" ,
296- Type : clause .OpCreateValues ,
296+ Type : clause .OpCreate ,
297297 Values : []interface {}{& newPet },
298298 }
299299
@@ -343,7 +343,7 @@ func TestClauseAssociationSetCreateWithManyToMany(t *testing.T) {
343343 // Test Set + Update with many-to-many association
344344 assocOp := clause.Association {
345345 Association : "Languages" ,
346- Type : clause .OpCreateValues ,
346+ Type : clause .OpCreate ,
347347 Values : []interface {}{langs [0 ], langs [1 ]},
348348 }
349349
@@ -402,7 +402,7 @@ func TestClauseAssociationSetCreateWithBelongsTo(t *testing.T) {
402402 }
403403}
404404
405- // BelongsTo: create and assign company via OpCreateValues
405+ // BelongsTo: create and assign company via OpCreate
406406func TestClauseAssociationSetUpdateBelongsToCreateValues (t * testing.T ) {
407407 ctx := context .Background ()
408408
@@ -411,7 +411,7 @@ func TestClauseAssociationSetUpdateBelongsToCreateValues(t *testing.T) {
411411 t .Fatalf ("failed to create user: %v" , err )
412412 }
413413
414- assocOp := clause.Association {Association : "Company" , Type : clause .OpCreateValues , Values : []interface {}{Company {Name : "Belongs-To-Co" }}}
414+ assocOp := clause.Association {Association : "Company" , Type : clause .OpCreate , Values : []interface {}{Company {Name : "Belongs-To-Co" }}}
415415 if rows , err := gorm.G [User ](DB ).Where ("id = ?" , user .ID ).Set (assocOp ).Update (ctx ); err != nil {
416416 t .Fatalf ("Set Update belongs-to create values failed: %v" , err )
417417 } else if rows != 0 {
@@ -538,7 +538,7 @@ func TestClauseAssociationSetUpdatePolymorphicTools(t *testing.T) {
538538 t .Fatalf ("create user: %v" , err )
539539 }
540540
541- createOp := clause.Association {Association : "Tools" , Type : clause .OpCreateValues , Values : []interface {}{Tools {Name : "wrench" }}}
541+ createOp := clause.Association {Association : "Tools" , Type : clause .OpCreate , Values : []interface {}{Tools {Name : "wrench" }}}
542542 if rows , err := gorm.G [User ](DB ).Where ("id = ?" , user .ID ).Set (createOp ).Update (ctx ); err != nil {
543543 t .Fatalf ("create tools: %v" , err )
544544 } else if rows != 0 {
@@ -909,7 +909,7 @@ func TestClauseAssociationSetUpdateAndDeleteManyOwnersMany2Many(t *testing.T) {
909909 AssertAssociationCount (t , u2 , "Languages" , 1 , "after delete" )
910910}
911911
912- // Test Set + Update with has-one (NamedPet) using OpCreateValues
912+ // Test Set + Update with has-one (NamedPet) using OpCreate
913913func TestClauseAssociationSetUpdateHasOneCreateValues (t * testing.T ) {
914914 ctx := context .Background ()
915915
@@ -920,7 +920,7 @@ func TestClauseAssociationSetUpdateHasOneCreateValues(t *testing.T) {
920920
921921 assocOp := clause.Association {
922922 Association : "NamedPet" ,
923- Type : clause .OpCreateValues ,
923+ Type : clause .OpCreate ,
924924 Values : []interface {}{Pet {Name : "named-pet" }},
925925 }
926926
0 commit comments