adding arbitrary join conditons for 1:many as well

This commit is contained in:
Matt Schiros 2019-01-18 11:11:48 -08:00
parent e355abe5e3
commit d69551bd39

View File

@ -372,6 +372,10 @@ func (scope *Scope) GetModelStruct() *ModelStruct {
polymorphicType.IsForeignKey = true polymorphicType.IsForeignKey = true
} }
} }
if arbitraryConditions, _ := field.TagSettingsGet("ARBITRARY_JOIN_CONDITIONS"); arbitraryConditions != "" {
relationship.ArbitraryJoinConditions = strings.Split(arbitraryConditions, ",")
}
// if no foreign keys defined with tag // if no foreign keys defined with tag
if len(foreignKeys) == 0 { if len(foreignKeys) == 0 {