mirror of
https://github.com/zhigang1992/MagicalRecord.git
synced 2026-01-12 22:48:38 +08:00
saveWithBlock was not saving parent contexts
This makes the saveWithBlock method consistent with it's background siblings.
This commit is contained in:
committed by
Stephen Vanterpool
parent
835b4675f6
commit
870ca22340
@@ -95,13 +95,13 @@
|
||||
{
|
||||
[self performBlockAndWait:^{
|
||||
[self MR_saveWithErrorCallback: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];
|
||||
if (self.parentContext) {
|
||||
[[self parentContext] performBlockAndWait:^{
|
||||
[[self parentContext] MR_saveErrorHandler:errorCallback];
|
||||
}];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void) MR_saveInBackgroundCompletion:(void (^)(void))completion;
|
||||
|
||||
@@ -66,7 +66,7 @@ void reset_action_queue(void)
|
||||
|
||||
if ([localContext hasChanges])
|
||||
{
|
||||
[localContext MR_saveNestedContextsErrorHandler:errorHandler];
|
||||
[localContext MR_saveErrorHandler:errorHandler];
|
||||
}
|
||||
|
||||
if (completion)
|
||||
|
||||
Reference in New Issue
Block a user