- Sort Score
- Num 10 results
- Language All
Results 1 - 6 of 6 for Polymorphic (0.06 seconds)
-
schema/relationship.go
// OwnerType string // } func (schema *Schema) buildPolymorphicRelation(relation *Relationship, field *Field) { polymorphic := field.TagSettings["POLYMORPHIC"] relation.Polymorphic = &Polymorphic{ Value: schema.Table, } var ( typeName = polymorphic + "Type" typeId = polymorphic + "ID" ) if value, ok := field.TagSettings["POLYMORPHICTYPE"]; ok { typeName = strings.TrimSpace(value) }
Created: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Sun Nov 16 04:11:05 GMT 2025 - 23.1K bytes - Click Count (1) -
schema/schema_helper_test.go
} if r.Polymorphic != nil { if r.Polymorphic.PolymorphicID.Name != relation.Polymorphic.ID { t.Errorf("schema %v relation's polymorphic id field expects %v, but got %v", s, relation.Polymorphic.ID, r.Polymorphic.PolymorphicID.Name) } if r.Polymorphic.PolymorphicType.Name != relation.Polymorphic.Type {Created: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Thu Aug 28 02:57:17 GMT 2025 - 7.5K bytes - Click Count (0) -
schema/schema_test.go
References: []Reference{{"ID", "User", "UserID", "Pet", "", true}}, }, { Name: "Toys", Type: schema.HasMany, Schema: "User", FieldSchema: "Toy", Polymorphic: Polymorphic{ID: "OwnerID", Type: "OwnerType", Value: "users"}, References: []Reference{{"ID", "User", "OwnerID", "Toy", "", true}, {"", "", "OwnerType", "Toy", "users", false}}, }, {Created: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Thu Aug 28 02:57:17 GMT 2025 - 13.3K bytes - Click Count (0) -
tests/association_generics_test.go
t.Fatalf("Set Update many2many clear failed: %v", err) } else if rows != 0 { t.Fatalf("expected 0 rows affected, got %d", rows) } AssertAssociationCount(t, user, "Languages", 0, "after clear") } // Polymorphic Tools create and unlink func TestClauseAssociationSetUpdatePolymorphicTools(t *testing.T) { ctx := context.Background() user := User{Name: "TestClauseAssociationSetUpdatePolymorphicTools", Age: 25}
Created: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Fri Sep 12 05:42:26 GMT 2025 - 37.9K bytes - Click Count (0) -
tests/associations_has_many_test.go
// Find var toys []Toy if DB.Model(&users).Association("Toys").Find(&toys); len(toys) != 6 { t.Errorf("toys count should be %v, but got %v", 6, len(toys)) } // Find Tools (polymorphic with custom type and id) var tools []Tools DB.Model(&users).Association("Tools").Find(&tools) if len(tools) != 2 { t.Errorf("tools count should be %v, but got %v", 2, len(tools)) } // Append
Created: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Fri Sep 12 04:33:27 GMT 2025 - 16.3K bytes - Click Count (0) -
doc/go_spec.html
<code>Add</code> and <code>Slice</code>. </li> </ul> <h4 id="Go_1.18">Go 1.18</h4> <p> The 1.18 release adds polymorphic functions and types ("generics") to the language. Specifically: </p> <ul> <li> The set of <a href="#Operators_and_punctuation">operators and punctuation</a> includes the new token <code>~</code>. </li>
Created: Tue Dec 30 11:13:12 GMT 2025 - Last Modified: Tue Dec 02 23:07:19 GMT 2025 - 286.5K bytes - Click Count (1)