saveWithBlock was not saving parent contexts

This makes the saveWithBlock method consistent with it's background
siblings.
This commit is contained in:
Tony Arnold
2012-10-16 16:32:34 +11:00
committed by Stephen Vanterpool
parent 835b4675f6
commit 870ca22340
2 changed files with 7 additions and 7 deletions

View File

@@ -95,13 +95,13 @@
{
[self performBlockAndWait:^{
[self MR_saveWithErrorCallback:errorCallback];
if (self.parentContext) {
[[self parentContext] performBlockAndWait:^{
[[self parentContext] MR_saveErrorHandler:errorCallback];
}];
}
}];
if (self == [[self class] MR_defaultContext])
{
// Since this is a synchronous call, I made the background context save synchronous as well to reflect the intent.
[[[self class] MR_rootSavingContext] MR_saveErrorHandler:errorCallback];
}
}
- (void) MR_saveInBackgroundCompletion:(void (^)(void))completion;

View File

@@ -66,7 +66,7 @@ void reset_action_queue(void)
if ([localContext hasChanges])
{
[localContext MR_saveNestedContextsErrorHandler:errorHandler];
[localContext MR_saveErrorHandler:errorHandler];
}
if (completion)