Skip to content

Commit 97880d5

Browse files
authored
Merge pull request #20 from ABridoux/develop
Develop
2 parents 1b39e2f + 15ff3ef commit 97880d5

File tree

5 files changed

+8
-127
lines changed

5 files changed

+8
-127
lines changed

README.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,3 @@ RandomEntity.request()
5050
```
5151

5252
More about that in the documentation.
53-
54-
## Fetch update
55-
56-
When the entity type implements `Fetchable`, it's possible to call the static `updatePublisher` function to create a publisher backed by a `NSFetchedResultsController` that will emit arrays of the entity. This is especially useful when working with a `NSDiffableDataSource`.
57-
58-
```swift
59-
let request = RandomEntity.request()
60-
.all(after: 10)
61-
.where(\.score >= 15 || \.name != "Joe")
62-
.sorted(by: .ascending(\.score), .descending(\.name))
63-
.nsValue
64-
65-
RandomEntity.updatePublisher(
66-
for: request
67-
in: context
68-
) // emits [RandomEntity]
69-
```

Sources/SafeFetching/FetchUpdate.swift

Lines changed: 0 additions & 105 deletions
This file was deleted.

Sources/SafeFetching/Predicate/Types/StringComparisonOptions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extension Optional where Wrapped == Builders.StringComparisonOptions {
4545
case .none:
4646
return operatorString
4747
case let .some(wrapped):
48-
return "\(wrapped)[\(wrapped.stringValue)]"
48+
return "\(operatorString)[\(wrapped.stringValue)]"
4949
}
5050
}
5151
}

Sources/SafeFetching/SafeFetching.docc/SafeFetching.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,5 @@ Use and `&&` and or `||` operators between predicates or with a single boolean k
8686
- ``Fetchable``
8787
- ``FetchResult``
8888

89-
### Fetch update
90-
- ``Fetchable/updatePublisher(for:)``
91-
- ``Fetchable/updatePublisher(for:in:)``
92-
9389
### Namespace
9490
- ``Builders``

Tests/SafeFetchingTests/BooleanPredicateBuilderTests.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ final class BooleanPredicateTests: XCTestCase {
3535
testNSFormat(\.property, .doesNotMatch(".*"), expecting: #"NOT property MATCHES ".*""#)
3636
}
3737

38+
func testString_comparisonOptions() {
39+
testNSFormat(\.property, .hasPrefix("Desp", options: .caseInsensitive), expecting: #"property BEGINSWITH[c] "Desp""#)
40+
testNSFormat(\.property, .hasPrefix("Desp", options: .diacriticInsensitive), expecting: #"property BEGINSWITH[d] "Desp""#)
41+
testNSFormat(\.property, .hasPrefix("Desp", options: .diacriticAndCaseInsensitive), expecting: #"property BEGINSWITH[cd] "Desp""#)
42+
testNSFormat(\.property, .hasPrefix("Desp", options: .normalized), expecting: #"property BEGINSWITH[n] "Desp""#)
43+
}
44+
3845
func testComparisonFormats_RawRepresentable() {
3946
testNSFormat(predicate: .stubRaw == .foo, expecting: #"stubRaw == 1"#)
4047
testNSFormat(predicate: .stubRaw != .bar, expecting: #"stubRaw != 2"#)

0 commit comments

Comments
 (0)