Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for update_column_02_newnew2 (0.12 sec)

  1. tests/update_test.go

    	var user3 User
    	DB.First(&user3, users[1].ID)
    
    	users[1].Age += 50
    	CheckUser(t, user3, *users[1])
    
    	// update with struct
    	DB.Model(users[1]).UpdateColumns(User{Name: "update_column_02_newnew2", Age: 200})
    	if users[1].Name != "update_column_02_newnew2" || users[1].Age != 200 {
    		t.Errorf("user 2 should be updated with update column")
    	}
    	AssertEqual(t, lastUpdatedAt.UnixNano(), users[1].UpdatedAt.UnixNano())
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Dec 04 03:50:58 UTC 2023
    - 30.3K bytes
    - Viewed (0)
Back to top