mirror of
https://github.com/ent/ent.git
synced 2026-05-22 09:31:45 +03:00
dialect/sqlgraph: fix M2O relation in neighbors-with check
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/198 Reviewed By: alexsn Differential Revision: D18707741 fbshipit-source-id: 69dd010e27ee07ffe44acc12003b9772220aaa2a
This commit is contained in:
committed by
Facebook Github Bot
parent
56335d6e12
commit
413bbad8d8
@@ -202,7 +202,7 @@ func HasNeighborsWith(q *Selector, s *Step, pred func(*Selector)) {
|
||||
matches := builder.Select(to.C(s.To.Column)).
|
||||
From(to)
|
||||
pred(matches)
|
||||
q.Where(In(from.C(s.From.Column), matches))
|
||||
q.Where(In(from.C(s.Edge.Columns[0]), matches))
|
||||
case r == O2M || (r == O2O && !s.Edge.Inverse):
|
||||
from := q.Table()
|
||||
to := builder.Table(s.Edge.Table)
|
||||
|
||||
Reference in New Issue
Block a user