forked from mirror/gorm
Add DB setting gorm:association_save_reference
This commit is contained in:
parent
b2b568daa8
commit
2940c553eb
|
@ -53,7 +53,9 @@ func saveAssociationCheck(scope *Scope, field *Field) (autoUpdate bool, autoCrea
|
||||||
autoCreate = checkTruth(value)
|
autoCreate = checkTruth(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
if value, ok := field.TagSettings["ASSOCIATION_SAVE_REFERENCE"]; ok {
|
if value, ok := scope.Get("gorm:association_save_reference"); ok {
|
||||||
|
saveReference = checkTruth(value)
|
||||||
|
} else if value, ok := field.TagSettings["ASSOCIATION_SAVE_REFERENCE"]; ok {
|
||||||
saveReference = checkTruth(value)
|
saveReference = checkTruth(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue