Skip to content
Snippets Groups Projects
Commit 099fffc6 authored by cramakri's avatar cramakri
Browse files

Correctly present the childrenPermIds in the entity

SVN: 27159
parent 4b3209d9
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,7 @@
@property (nonatomic, retain) NSString * imageUrl;
@property (nonatomic, retain) NSString * childrenPermIdsJson;
@property (nonatomic, retain) NSArray * childrenPermIds;
@property (readonly) NSArray * childrenPermIds;
@property (nonatomic, retain) NSString * propertiesJson;
@property (readonly) NSArray * properties;
......
......@@ -71,7 +71,7 @@
if (nil == childrenPermIds) {
NSError *error;
NSArray *childrenPermIds = [NSJSONSerialization JSONObjectWithData: [self.propertiesJson dataUsingEncoding: NSASCIIStringEncoding] options: 0 error: &error];
childrenPermIds = [NSJSONSerialization JSONObjectWithData: [self.childrenPermIdsJson dataUsingEncoding: NSASCIIStringEncoding] options: 0 error: &error];
if (error) {
NSLog(@"Could not deserialize childrenPermIds %@", error);
}
......
......@@ -90,6 +90,11 @@ NSManagedObjectContext* GetDatabaseManagedObjectContext(NSURL* storeURL, NSError
// Create new entities in the moc, and store them.
CISDOBIpadEntity *entity = [NSEntityDescription insertNewObjectForEntityForName: @"CISDOBIpadEntity" inManagedObjectContext: _moc];
[entity initializeFromRawEntity: rawEntity];
// Make sure that the children collection is parsable
if ([rawEntity.children length] > 2) {
STAssertTrue([entity.childrenPermIds count] > 0, @"%@ should result in an entity with children", rawEntity.children);
}
}
NSError *error;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment