Skip to content

Commit 8229f1e

Browse files
committed
Add public BuildCondition method for associations
1 parent 9d370bc commit 8229f1e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

association.go

+10
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ func (db *DB) Association(column string) *Association {
4141
return association
4242
}
4343

44+
func (association *Association) BuildCondition() *DB {
45+
if association.Error != nil {
46+
tx := association.DB
47+
tx.Error = association.Error
48+
return tx
49+
}
50+
51+
return association.buildCondition()
52+
}
53+
4454
func (association *Association) Unscoped() *Association {
4555
return &Association{
4656
DB: association.DB,

0 commit comments

Comments
 (0)