Permalink
Browse files

Set the merge policy for the root saving context only.

  • Loading branch information...
1 parent 1f4f06b commit 209e7f235168d89ba09f79c0bfced4d9a2629723 @casademora casademora committed May 26, 2012
@@ -73,6 +73,7 @@ + (NSManagedObjectContext *) MR_rootSavingContext;
+ (void) MR_setRootSavingContext:(NSManagedObjectContext *)context;
{
rootSavingContext = context;
+ [rootSavingContext setMergePolicy:NSMergeByPropertyObjectTrumpMergePolicy];
}
+ (void) MR_initializeDefaultContextWithCoordinator:(NSPersistentStoreCoordinator *)coordinator;
@@ -85,7 +86,7 @@ + (void) MR_initializeDefaultContextWithCoordinator:(NSPersistentStoreCoordinato
NSManagedObjectContext *defaultContext = [self MR_newMainQueueContext];
[defaultContext setParentContext:rootSavingContext];
-
+
[self MR_setDefaultContext:defaultContext];
}
}
@@ -66,8 +66,6 @@ + (void) saveWithBlock:(void (^)(NSManagedObjectContext *localContext))block com
{
[localContext MR_saveErrorHandler:errorHandler];
}
-
- [mainContext setMergePolicy:NSMergeByPropertyObjectTrumpMergePolicy];
if (completion)
{

0 comments on commit 209e7f2

Please sign in to comment.