Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for EmbeddedRelations (0.14 sec)

  1. callbacks/preload.go

    	}
    	names := make([]string, 0, len(embeddedRelations.Relations)+len(embeddedRelations.EmbeddedRelations))
    	for _, relation := range embeddedRelations.Relations {
    		// skip first struct name
    		names = append(names, strings.Join(relation.Field.EmbeddedBindNames[1:], "."))
    	}
    	for _, relations := range embeddedRelations.EmbeddedRelations {
    		names = append(names, embeddedValues(relations)...)
    	}
    	return names
    }
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jun 12 10:52:33 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  2. schema/schema_helper_test.go

    		}
    	})
    }
    
    type EmbeddedRelations struct {
    	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]
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Fri Dec 15 08:31:23 UTC 2023
    - 7.5K bytes
    - Viewed (0)
  3. schema/relationship_test.go

    	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,
    					Schema:      "User",
    					FieldSchema: "Toy",
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Apr 15 03:20:20 UTC 2024
    - 25.5K bytes
    - Viewed (0)
  4. schema/relationship.go

    		if i < len(relation.Field.EmbeddedBindNames)-1 {
    			if relationships.EmbeddedRelations == nil {
    				relationships.EmbeddedRelations = map[string]*Relationships{}
    			}
    			if r := relationships.EmbeddedRelations[name]; r == nil {
    				relationships.EmbeddedRelations[name] = &Relationships{}
    			}
    			relationships = relationships.EmbeddedRelations[name]
    		} else {
    			if relationships.Relations == nil {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jun 12 03:46:59 UTC 2024
    - 22.7K bytes
    - Viewed (0)
Back to top