Add public BuildCondition method for associations

This commit is contained in:
greencoda 2024-05-08 02:15:02 +02:00
parent 9d370bcb3e
commit d95ad7b49d
1 changed files with 10 additions and 0 deletions

View File

@ -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,