MCPcopy
hub / github.com/go-gorm/gorm / checkAssociationsSaved

Function checkAssociationsSaved

callbacks/associations.go:439–453  ·  view source on GitHub ↗
(db *gorm.DB, values reflect.Value)

Source from the content-addressed store, hash-verified

437var visitMapStoreKey = "gorm:saved_association_map"
438
439func checkAssociationsSaved(db *gorm.DB, values reflect.Value) bool {
440 if visit, ok := db.Get(visitMapStoreKey); ok {
441 if v, ok := visit.(*visitMap); ok {
442 if loadOrStoreVisitMap(v, values) {
443 return true
444 }
445 }
446 } else {
447 vistMap := make(visitMap)
448 loadOrStoreVisitMap(&vistMap, values)
449 db.Set(visitMapStoreKey, &vistMap)
450 }
451
452 return false
453}

Callers 1

saveAssociationsFunction · 0.85

Calls 3

loadOrStoreVisitMapFunction · 0.85
GetMethod · 0.65
SetMethod · 0.65

Tested by

no test coverage detected