fix: unsupported data on nested joins with preloads

This commit is contained in:
Nico Schäfer 2024-04-11 07:11:44 +00:00 committed by GitHub
parent 1e13fd7543
commit 2aeabe29e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -130,7 +130,7 @@ func preloadEntryPoint(db *gorm.DB, joins []string, relationships *schema.Relati
return err
}
}
case reflect.Struct:
case reflect.Struct, reflect.Pointer:
reflectValue := rel.Field.ReflectValueOf(db.Statement.Context, rv)
tx := preloadDB(db, reflectValue, reflectValue.Interface())
if err := preloadEntryPoint(tx, nestedJoins, &tx.Statement.Schema.Relationships, preloadMap[name], associationsConds); err != nil {