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
greencoda committed May 8, 2024
1 parent 9d370bc commit d95ad7b
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 d95ad7b

Please sign in to comment.