mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-23 20:31:13 +08:00
Added test coverage for creation of duplicate objects. refs #661
This commit is contained in:
@@ -160,6 +160,8 @@
|
||||
NSString* keyPathForPrimaryKeyElement = primaryKeyAttributeMapping.sourceKeyPath;
|
||||
if (keyPathForPrimaryKeyElement) {
|
||||
primaryKeyValue = [mappableData valueForKeyPath:keyPathForPrimaryKeyElement];
|
||||
} else {
|
||||
RKLogWarning(@"Unable to find source attribute for primaryKeyAttribute '%@': unable to find existing object instances by primary key.", primaryKeyAttribute);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,8 +126,7 @@ static RKManagedObjectStore *defaultObjectStore = nil;
|
||||
}
|
||||
NSMutableArray* allManagedObjectModels = [NSMutableArray arrayWithObject:nilOrManagedObjectModel];
|
||||
_managedObjectModel = [[NSManagedObjectModel modelByMergingModels:allManagedObjectModels] retain];
|
||||
|
||||
_delegate = delegate;
|
||||
_delegate = delegate;
|
||||
|
||||
if (nilOrNameOfSeedDatabaseInMainBundle) {
|
||||
[self createStoreIfNecessaryUsingSeedDatabase:nilOrNameOfSeedDatabaseInMainBundle];
|
||||
@@ -136,7 +135,7 @@ static RKManagedObjectStore *defaultObjectStore = nil;
|
||||
[self createPersistentStoreCoordinator];
|
||||
self.primaryManagedObjectContext = [[self newManagedObjectContext] autorelease];
|
||||
|
||||
_cacheStrategy = [RKFetchRequestManagedObjectCache new];
|
||||
_cacheStrategy = [RKInMemoryManagedObjectCache new];
|
||||
|
||||
// Ensure there is a search word observer
|
||||
[RKSearchWordObserver sharedObserver];
|
||||
|
||||
Reference in New Issue
Block a user