RowAdapter.addingScopes returns self if the scopes dictionary is empty

This commit is contained in:
Gwendal Roué committed 2018-04-30 14:04:07 +02:00
1 parent df79bb8ed8
commit 9f78a758bd
2 files changed
+6 -2

No files matched your search

+5 -1
View File
@@ -237,7 +237,11 @@ extension RowAdapter {
/// - parameter scopes: A dictionary that maps scope names to
/// row adapters.
public func addingScopes(_ scopes: [String: RowAdapter]) -> RowAdapter {
return ScopeAdapter(base: self, scopes: scopes)
if scopes.isEmpty {
return self
} else {
return ScopeAdapter(base: self, scopes: scopes)
}
}
}
+1 -1
View File
@@ -27,7 +27,7 @@ GRDB 3.0
- sync
- ?
- [ ] filter(rowid:), filter(rowids:)
- [ ] If required by associations, make reversed() make nothing when there is no alraedy applied ordering
- [ ] hide ScopeAdapter(base, scopes), because base.addingScopes has a better implementation
Not sure