From 9d5c68e41000fd15dea124797dd5f2656bf6b304 Mon Sep 17 00:00:00 2001 From: chenrui Date: Thu, 10 Mar 2022 20:33:47 +0800 Subject: [PATCH] chore: add more comment --- callbacks/associations.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/callbacks/associations.go b/callbacks/associations.go index f5b208fe..0ab614db 100644 --- a/callbacks/associations.go +++ b/callbacks/associations.go @@ -397,6 +397,8 @@ func saveAssociations(db *gorm.DB, rel *schema.Relationship, values interface{}, } // check association values has been saved +// if values kind is Struct, check it has been saved. +// if values kind is Slice/Array, check all item has been saved. func checkAssociationsSaved(db *gorm.DB, values interface{}) (saved bool) { visitMapStoreKey := "gorm:saved_association_map" var vistMap VisitMap