Compare commits

...

2 Commits

Author SHA1 Message Date
Adam Glazer cd869a0b5e
Merge d95ad7b49d into 49bbaa637f 2024-11-14 17:43:38 +08:00
greencoda d95ad7b49d Add public BuildCondition method for associations 2024-05-08 02:15:02 +02:00
1 changed files with 10 additions and 0 deletions

View File

@ -41,6 +41,16 @@ func (db *DB) Association(column string) *Association {
return 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 { func (association *Association) Unscoped() *Association {
return &Association{ return &Association{
DB: association.DB, DB: association.DB,