Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for checkEmbeddedRelations (0.11 sec)

  1. schema/relationship_test.go

    		Toys []Toy `gorm:"polymorphic:Owner;"`
    	}
    
    	s, err := schema.Parse(&User{}, &sync.Map{}, schema.NamingStrategy{})
    	if err != nil {
    		t.Fatalf("Failed to parse schema, got error %v", err)
    	}
    
    	checkEmbeddedRelations(t, s.Relationships.EmbeddedRelations, map[string]EmbeddedRelations{
    		"Cat": {
    			Relations: map[string]Relation{
    				"Toy": {
    					Name:        "Toy",
    					Type:        schema.HasOne,
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Apr 15 03:20:20 UTC 2024
    - 25.5K bytes
    - Viewed (0)
  2. schema/schema_helper_test.go

    	Relations         map[string]Relation
    	EmbeddedRelations map[string]EmbeddedRelations
    }
    
    func checkEmbeddedRelations(t *testing.T, actual map[string]*schema.Relationships, expected map[string]EmbeddedRelations) {
    	for name, relations := range actual {
    		rs := expected[name]
    		t.Run("CheckEmbeddedRelations/"+name, func(t *testing.T) {
    			if len(relations.Relations) != len(rs.Relations) {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Fri Dec 15 08:31:23 UTC 2023
    - 7.5K bytes
    - Viewed (0)
Back to top