Skip to content

Commit

Permalink
fix: context missing in association (#5214)
Browse files Browse the repository at this point in the history
  • Loading branch information
goxiaoy committed Apr 1, 2022
1 parent 8333844 commit cd03153
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion association.go
Expand Up @@ -502,7 +502,7 @@ func (association *Association) buildCondition() *DB {

if association.Relationship.JoinTable != nil {
if !tx.Statement.Unscoped && len(association.Relationship.JoinTable.QueryClauses) > 0 {
joinStmt := Statement{DB: tx, Schema: association.Relationship.JoinTable, Table: association.Relationship.JoinTable.Table, Clauses: map[string]clause.Clause{}}
joinStmt := Statement{DB: tx, Context: tx.Statement.Context, Schema: association.Relationship.JoinTable, Table: association.Relationship.JoinTable.Table, Clauses: map[string]clause.Clause{}}
for _, queryClause := range association.Relationship.JoinTable.QueryClauses {
joinStmt.AddClause(queryClause)
}
Expand Down

0 comments on commit cd03153

Please sign in to comment.