Skip to content

Commit

Permalink
Fix one letter local keys support
Browse files Browse the repository at this point in the history
CoreData doesn’t allow you to make fields that start with an uppercase
  • Loading branch information
3lvis committed Nov 2, 2014
1 parent 0a0f78a commit a6167db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ - (void)testRemoteString

XCTAssertEqualObjects(remoteKey, [localKey remoteString]);

localKey = @"ID";
localKey = @"id";
remoteKey = @"id";

XCTAssertEqualObjects(remoteKey, [localKey remoteString]);

localKey = @"PDF";
localKey = @"pdf";
remoteKey = @"pdf";

XCTAssertEqualObjects(remoteKey, [localKey remoteString]);
Expand Down Expand Up @@ -126,12 +126,12 @@ - (void)testLocalString
XCTAssertEqualObjects(localKey, [remoteKey localString]);

remoteKey = @"id";
localKey = @"ID";
localKey = @"id";

XCTAssertEqualObjects(localKey, [remoteKey localString]);

remoteKey = @"pdf";
localKey = @"PDF";
localKey = @"pdf";

XCTAssertEqualObjects(localKey, [remoteKey localString]);

Expand Down
2 changes: 1 addition & 1 deletion Source/NSManagedObject+HYPPropertyMapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ - (NSString *)localString

BOOL remoteStringIsAnAcronym = ([[NSString acronyms] containsObject:[processedString lowercaseString]]);

return (remoteStringIsAnAcronym) ? processedString : [processedString lowerCaseFirstLetter];
return (remoteStringIsAnAcronym) ? [processedString lowercaseString] : [processedString lowerCaseFirstLetter];
}

- (NSString *)lowerCaseFirstLetter
Expand Down

0 comments on commit a6167db

Please sign in to comment.