Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for Account (0.4 sec)

  1. tests/associations_has_one_test.go

    	account := Account{Number: "account-has-one-append"}
    
    	if err := DB.Model(&user2).Association("Account").Append(&account); err != nil {
    		t.Fatalf("Error happened when append account, got %v", err)
    	}
    
    	if account.ID == 0 {
    		t.Fatalf("Account's ID should be created")
    	}
    
    	user.Account = account
    	CheckUser(t, user2, user)
    
    	AssertAssociationCount(t, user, "Account", 1, "AfterAppend")
    
    	// Replace
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:49:45 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  2. tests/helper_test.go

    		"ManagerID", "Active")
    
    	t.Run("Account", func(t *testing.T) {
    		AssertObjEqual(t, user.Account, expect.Account, "ID", "CreatedAt", "UpdatedAt", "DeletedAt", "UserID", "Number")
    
    		if user.Account.Number != "" {
    			if !user.Account.UserID.Valid {
    				t.Errorf("Account's foreign key should be saved")
    			} else {
    				var account Account
    				db(unscoped).First(&account, "user_id = ?", user.ID)
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Tue Mar 19 03:50:28 UTC 2024
    - 8K bytes
    - Viewed (0)
  3. tests/non_std_test.go

    		t.Errorf("UpdatedAt should be updated")
    	}
    
    	var animals []Animal
    	DB.Find(&animals)
    	if count := DB.Model(Animal{}).Where("1=1").Update("CreatedAt", time.Now().Add(2*time.Hour)).RowsAffected; count != int64(len(animals)) {
    		t.Error("RowsAffected should be correct when do batch update")
    	}
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed May 08 04:07:58 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  4. errors.go

    	ErrInvalidValueOfLength = errors.New("invalid association values, length doesn't match")
    	// ErrPreloadNotAllowed preload is not allowed when count is used
    	ErrPreloadNotAllowed = errors.New("preload is not allowed when count is used")
    	// ErrDuplicatedKey occurs when there is a unique key constraint violation
    	ErrDuplicatedKey = errors.New("duplicated key not allowed")
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Fri Apr 26 02:53:17 UTC 2024
    - 2.5K bytes
    - Viewed (0)
Back to top