mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-11-18 22:58:28 +01:00
added mechanism to track transaction sources
This commit is contained in:
1 parent
45215c7a18
commit
4ddfa95140
26 files changed
+1323
-179
No files matched your search
@@ -113,6 +113,10 @@ extension NSManagedObjectContext {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
let saveMetadata = rootContext.saveMetadata
|
||||
context.saveMetadata = saveMetadata
|
||||
|
||||
let mergeChanges = { () -> Void in
|
||||
|
||||
if let updatedObjects = (note.userInfo?[NSUpdatedObjectsKey] as? Set<NSManagedObject>) {
|
||||
@@ -123,8 +127,9 @@ extension NSManagedObjectContext {
|
||||
}
|
||||
}
|
||||
context.mergeChanges(fromContextDidSave: note)
|
||||
context.saveMetadata = nil
|
||||
}
|
||||
if rootContext.isSavingSynchronously == true {
|
||||
if case true? = saveMetadata?.isSavingSynchronously {
|
||||
|
||||
context.performAndWait(mergeChanges)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user