Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for updates_01_newname (0.19 sec)

  1. tests/update_test.go

    	lastUpdatedAt := users[0].UpdatedAt
    
    	// update with map
    	if res := DB.Model(users[0]).Updates(map[string]interface{}{"name": "updates_01_newname", "age": 100}); res.Error != nil || res.RowsAffected != 1 {
    		t.Errorf("Failed to update users")
    	}
    
    	if users[0].Name != "updates_01_newname" || users[0].Age != 100 {
    		t.Errorf("Record should be updated also with map")
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
Back to top