mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-19 07:53:56 +01:00
Revert ObjectMonitor to previous implementation
This commit is contained in:
@@ -56,10 +56,15 @@ public struct ObjectSnapshot<O: DynamicObject>: SnapshotResult, ObjectRepresenta
|
||||
let context = dataStack.unsafeContext()
|
||||
return .init(objectID: self.id, context: context)
|
||||
}
|
||||
|
||||
public func asReadOnly(in dataStack: DataStack) -> O? {
|
||||
|
||||
return dataStack.unsafeContext().fetchExisting(self.id)
|
||||
}
|
||||
|
||||
public func asEditable(in transaction: BaseDataTransaction) -> O? {
|
||||
|
||||
return self.context.fetchExisting(self.id)
|
||||
return transaction.unsafeContext().fetchExisting(self.id)
|
||||
}
|
||||
|
||||
public func asSnapshot(in dataStack: DataStack) -> ObjectSnapshot<O>? {
|
||||
@@ -81,11 +86,6 @@ public struct ObjectSnapshot<O: DynamicObject>: SnapshotResult, ObjectRepresenta
|
||||
}
|
||||
return .init(objectID: self.id, context: context)
|
||||
}
|
||||
|
||||
public func asObjectMonitor(in dataStack: DataStack) -> ObjectMonitor<O>? {
|
||||
|
||||
return .init(objectID: self.id, context: dataStack.unsafeContext())
|
||||
}
|
||||
|
||||
|
||||
// MARK: Equatable
|
||||
@@ -112,7 +112,7 @@ public struct ObjectSnapshot<O: DynamicObject>: SnapshotResult, ObjectRepresenta
|
||||
|
||||
self.id = objectID
|
||||
self.context = context
|
||||
self.values = O.cs_snapshotDictionary(id: id, context: context) as NSDictionary
|
||||
self.values = O.cs_snapshotDictionary(id: objectID, context: context) as NSDictionary
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user