allow nested transactions

This commit is contained in:
John Rommel Estropia
2015-02-28 00:55:22 +09:00
parent c71198347d
commit a45c94dd52
9 changed files with 62 additions and 20 deletions

View File

@@ -54,7 +54,7 @@ internal extension NSManagedObjectContext {
context.parentContext = self
context.parentStack = self.parentStack
context.setupForHardcoreDataWithContextName("com.hardcoredata.temporarycontext")
context.shouldCascadeSavesToParent = true
context.shouldCascadeSavesToParent = (self.concurrencyType == .MainQueueConcurrencyType)
return context
}
@@ -67,7 +67,6 @@ internal extension NSManagedObjectContext {
if !self.hasChanges {
self.reset()
return
}