Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for berate (0.14 sec)

  1. tests/associations_has_one_test.go

    import (
    	"testing"
    
    	. "gorm.io/gorm/utils/tests"
    )
    
    func TestHasOneAssociation(t *testing.T) {
    	user := *GetUser("hasone", Config{Account: true})
    
    	if err := DB.Create(&user).Error; err != nil {
    		t.Fatalf("errors happened when create: %v", err)
    	}
    
    	CheckUser(t, user, user)
    
    	// Find
    	var user2 User
    	DB.Find(&user2, "id = ?", user.ID)
    	DB.Model(&user2).Association("Account").Find(&user2.Account)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 6.8K bytes
    - Viewed (0)
Back to top