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