Added test coverage for creation of duplicate objects. refs #661

This commit is contained in:
Blake Watters
2012-04-30 20:31:28 -04:00
parent 1edaaa5eb2
commit 5a53fdbf1e
7 changed files with 106 additions and 4 deletions

View File

@@ -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);
}
}
}

View File

@@ -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];