Move firstInMany flag in SQLRelation

This commit is contained in:
Gwendal Roué committed 2020-04-18 17:06:29 +02:00
1 parent da63037948
commit 8057572357
3 files changed
+27 -38

No files matched your search

@@ -496,10 +496,11 @@ private struct SQLQualifiedRelation {
return nil
}
if child.firstOnly {
if child.relation.firstInMany {
// Filters and order are handled in a subquery,
// and only keep children with a non-empty selection
let relation = child.relation
.with(\.firstInMany, false)
.unfiltered()
.unordered()
.filteringChildren { $0.relation.selection.isEmpty == false }