Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for Wang (0.15 sec)

  1. tests/update_test.go

    func TestSaveWithPrimaryValue(t *testing.T) {
    	lang := Language{Code: "save", Name: "save"}
    	if result := DB.Save(&lang); result.RowsAffected != 1 {
    		t.Errorf("should create language, rows affected: %v", result.RowsAffected)
    	}
    
    	var result Language
    	DB.First(&result, "code = ?", "save")
    	AssertEqual(t, result, lang)
    
    	lang.Name = "save name2"
    	if result := DB.Save(&lang); result.RowsAffected != 1 {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
Back to top