Skip to content

Commit cce4185

Browse files
committed
Fix name of IdentifiedUnmanagedModel.unmanagedIdExpression
feature/fix-misnamed-property # Conflicts: # Sources/CoreDataRepository/IdentifiedUnmanagedModel.swift # Sources/Internal/ModelsWithIntId/IdentifiableModel_Int.swift # Sources/Internal/ModelsWithUuidId/IdentifiableModel_Uuid.swift
1 parent da539b7 commit cce4185

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

Sources/CoreDataRepository/IdentifiedUnmanagedModel.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import CoreData
99
public protocol IdentifiedUnmanagedModel: ReadableUnmanagedModel {
1010
associatedtype UnmanagedId: Equatable
1111
static var unmanagedIdAccessor: (Self) -> UnmanagedId { get }
12-
static var managedIdExpression: NSExpression { get }
12+
/// `NSExpression` for the `unmanagedId` property on `ManagedModel`
13+
static var unmanagedIdExpression: NSExpression { get }
1314
}
1415

1516
extension IdentifiedUnmanagedModel {
@@ -22,7 +23,7 @@ extension IdentifiedUnmanagedModel {
2223
public static func readManaged(id: UnmanagedId, from context: NSManagedObjectContext) throws -> ManagedModel {
2324
let request = Self.managedFetchRequest()
2425
request.predicate = NSComparisonPredicate(
25-
leftExpression: Self.managedIdExpression,
26+
leftExpression: Self.unmanagedIdExpression,
2627
rightExpression: NSExpression(forConstantValue: id),
2728
modifier: .direct,
2829
type: .equalTo

Sources/Internal/ModelsWithIntId/IdentifiableModel_Int.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ extension IdentifiableModel_IntId: IdentifiedUnmanagedModel {
101101

102102
@inlinable
103103
package static var unmanagedIdAccessor: (IdentifiableModel_IntId) -> Int { \.id }
104-
package nonisolated(unsafe) static let managedIdExpression = NSExpression(forKeyPath: \ManagedModel_IntId.id)
104+
package nonisolated(unsafe) static let unmanagedIdExpression = NSExpression(forKeyPath: \ManagedModel_IntId.id)
105105
}
106106

107107
extension IdentifiableModel_IntId: WritableUnmanagedModel {

Sources/Internal/ModelsWithUuidId/IdentifiableModel_Uuid.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ extension IdentifiableModel_UuidId: IdentifiedUnmanagedModel {
101101

102102
@inlinable
103103
package static var unmanagedIdAccessor: (IdentifiableModel_UuidId) -> UUID { \.id }
104-
package nonisolated(unsafe) static let managedIdExpression = NSExpression(forKeyPath: \ManagedModel_UuidId.id)
104+
package nonisolated(unsafe) static let unmanagedIdExpression = NSExpression(forKeyPath: \ManagedModel_UuidId.id)
105105
}
106106

107107
extension IdentifiableModel_UuidId: WritableUnmanagedModel {

0 commit comments

Comments
 (0)