formatting cleanup
This commit is contained in:
parent
6ecce561e6
commit
e355abe5e3
@ -39,10 +39,10 @@ type JoinTableSource struct {
|
|||||||
|
|
||||||
// JoinTableHandler default join table handler
|
// JoinTableHandler default join table handler
|
||||||
type JoinTableHandler struct {
|
type JoinTableHandler struct {
|
||||||
TableName string `sql:"-"`
|
TableName string `sql:"-"`
|
||||||
Source JoinTableSource `sql:"-"`
|
Source JoinTableSource `sql:"-"`
|
||||||
Destination JoinTableSource `sql:"-"`
|
Destination JoinTableSource `sql:"-"`
|
||||||
ArbitraryJoinConditions []string `sql:"-"`
|
ArbitraryJoinConditions []string `sql:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SourceForeignKeys return source foreign keys
|
// SourceForeignKeys return source foreign keys
|
||||||
@ -67,7 +67,7 @@ func (s *JoinTableHandler) Setup(relationship *Relationship, tableName string, s
|
|||||||
AssociationDBName: dbName,
|
AssociationDBName: dbName,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
s.Destination = JoinTableSource{ModelType: destination}
|
s.Destination = JoinTableSource{ModelType: destination}
|
||||||
s.Destination.ForeignKeys = []JoinTableForeignKey{}
|
s.Destination.ForeignKeys = []JoinTableForeignKey{}
|
||||||
for idx, dbName := range relationship.AssociationForeignFieldNames {
|
for idx, dbName := range relationship.AssociationForeignFieldNames {
|
||||||
|
@ -342,11 +342,10 @@ func (scope *Scope) GetModelStruct() *ModelStruct {
|
|||||||
|
|
||||||
// Check for arbitrary join conditions supplied in the tag
|
// Check for arbitrary join conditions supplied in the tag
|
||||||
|
|
||||||
if arbitraryConditions,_ := field.TagSettingsGet("ARBITRARY_JOIN_CONDITIONS"); arbitraryConditions != "" {
|
if arbitraryConditions, _ := field.TagSettingsGet("ARBITRARY_JOIN_CONDITIONS"); arbitraryConditions != "" {
|
||||||
relationship.ArbitraryJoinConditions = strings.Split(arbitraryConditions, ",")
|
relationship.ArbitraryJoinConditions = strings.Split(arbitraryConditions, ",")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
joinTableHandler := JoinTableHandler{}
|
joinTableHandler := JoinTableHandler{}
|
||||||
joinTableHandler.Setup(relationship, ToTableName(many2many), reflectType, elemType)
|
joinTableHandler.Setup(relationship, ToTableName(many2many), reflectType, elemType)
|
||||||
relationship.JoinTableHandler = &joinTableHandler
|
relationship.JoinTableHandler = &joinTableHandler
|
||||||
|
Loading…
x
Reference in New Issue
Block a user