Apply rootKeyPath within the mapper rather than the object loader

This commit is contained in:
Blake Watters
2012-01-18 08:45:34 -05:00
parent 7c5ad95816
commit 4bd12ea987
4 changed files with 7 additions and 4 deletions

View File

@@ -334,7 +334,9 @@
} else if ([mappingsForContext conformsToProtocol:@protocol(RKObjectMappingDefinition)]) {
id mappableData = self.sourceObject;
if ([mappingsForContext respondsToSelector:@selector(rootKeyPath)] && [mappingsForContext rootKeyPath] != nil) {
mappableData = [self.sourceObject valueForKeyPath:[mappingsForContext rootKeyPath]];
NSString* rootKeyPath = [mappingsForContext rootKeyPath];
mappableData = [self.sourceObject valueForKeyPath:rootKeyPath];
RKLogDebug(@"Selected object mapping has rootKeyPath. Apply valueForKeyPath to mappable data: %@", rootKeyPath);
}
if (mappableData) {