mirror of https://github.com/go-gorm/gorm.git
Add public BuildCondition method for associations
This commit is contained in:
parent
9d370bcb3e
commit
d95ad7b49d
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue