Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for 150 (0.17 sec)

  1. tests/hooks_test.go

    	if product.Price != 100 {
    		t.Errorf("invalid price after create, got %+v", product)
    	}
    
    	DB.Model(&product).Select("code", "price").Updates(map[string]interface{}{"code": "L1212"})
    
    	if product.Price != 150 || product.Code != "L1212" {
    		t.Errorf("invalid data after update, got %+v", product)
    	}
    
    	// Code not changed, price should not change
    	DB.Model(&product).Updates(map[string]interface{}{"Name": "Product New"})
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Feb 18 01:20:29 GMT 2023
    - 15.9K bytes
    - Viewed (0)
Back to top