mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: add support for referencing fks to existing fields (#1289)
This commit is contained in:
@@ -482,7 +482,8 @@ func (gq *GroupQuery) sqlAll(ctx context.Context) ([]*Group, error) {
|
||||
ids := make([]int, 0, len(nodes))
|
||||
nodeids := make(map[int][]*Group)
|
||||
for i := range nodes {
|
||||
if fk := nodes[i].group_admin; fk != nil {
|
||||
fk := nodes[i].group_admin
|
||||
if fk != nil {
|
||||
ids = append(ids, *fk)
|
||||
nodeids[*fk] = append(nodeids[*fk], nodes[i])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user