Skip to content

Commit

Permalink
Add public BuildCondition method for associations
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamGlazerMW committed May 8, 2024
1 parent 9d370bc commit 8229f1e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions association.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ func (db *DB) Association(column string) *Association {
return association
}

func (association *Association) BuildCondition() *DB {
if association.Error != nil {
tx := association.DB
tx.Error = association.Error
return tx
}

return association.buildCondition()
}

func (association *Association) Unscoped() *Association {
return &Association{
DB: association.DB,
Expand Down

0 comments on commit 8229f1e

Please # to comment.