From 1be54d09b3301e8b50b15eff18682755a7bdd76f Mon Sep 17 00:00:00 2001 From: Caleb Xiang Date: Thu, 31 Dec 2020 11:29:02 +0800 Subject: [PATCH] fix transcation lock issue --- nested_set.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nested_set.go b/nested_set.go index d4563c5..ad9a820 100644 --- a/nested_set.go +++ b/nested_set.go @@ -167,8 +167,7 @@ func Create(db *gorm.DB, source, parent interface{}) error { } } - // skip the table & scope, since they should be all setup by caller - return db.Create(source).Error + return tx.Create(source).Error }) }