mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-24 18:31:41 +01:00
added mechanism to track transaction sources
This commit is contained in:
@@ -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