From a6167db667d9143c0bb5da7998beb6a2a240af96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elvis=20Nu=C3=B1ez?= Date: Sun, 2 Nov 2014 03:04:01 +0100 Subject: [PATCH 1/2] Fix one letter local keys support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CoreData doesn’t allow you to make fields that start with an uppercase --- .../NSManagedObject_HYPPropertyMapperTests.m | 8 ++++---- Source/NSManagedObject+HYPPropertyMapper.m | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/NSManagedObject-HYPPropertyMapperTests/NSManagedObject_HYPPropertyMapperTests.m b/NSManagedObject-HYPPropertyMapperTests/NSManagedObject_HYPPropertyMapperTests.m index 30a3663..7f83003 100644 --- a/NSManagedObject-HYPPropertyMapperTests/NSManagedObject_HYPPropertyMapperTests.m +++ b/NSManagedObject-HYPPropertyMapperTests/NSManagedObject_HYPPropertyMapperTests.m @@ -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]); @@ -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]); diff --git a/Source/NSManagedObject+HYPPropertyMapper.m b/Source/NSManagedObject+HYPPropertyMapper.m index 693a026..558bec9 100644 --- a/Source/NSManagedObject+HYPPropertyMapper.m +++ b/Source/NSManagedObject+HYPPropertyMapper.m @@ -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 From 6d1e83c01bcfd7021595d7e81374b402eaeb7ca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elvis=20Nu=C3=B1ez?= Date: Sun, 2 Nov 2014 03:08:42 +0100 Subject: [PATCH 2/2] Update NSManagedObject-HYPPropertyMapper.podspec --- NSManagedObject-HYPPropertyMapper.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NSManagedObject-HYPPropertyMapper.podspec b/NSManagedObject-HYPPropertyMapper.podspec index 864a5eb..221aa68 100644 --- a/NSManagedObject-HYPPropertyMapper.podspec +++ b/NSManagedObject-HYPPropertyMapper.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "NSManagedObject-HYPPropertyMapper" - s.version = "1.6" + s.version = "1.7" s.summary = "Mapping your Core Data objects with your JSON providing backend has never been this easy" s.description = <<-DESC * Mapping your Core Data objects with your JSON providing backend has never been this easy