Skip to content

Commit

Permalink
Merge pull request #388 from mitchins/master
Browse files Browse the repository at this point in the history
Address #387, "Current Product Module" issues with swift/Xcode-11.3
  • Loading branch information
rentzsch authored Jul 6, 2020
2 parents 797dcd5 + 656d22a commit 1294723
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mogenerator.m
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,15 @@ - (NSString*)customSuperentity {
return forcedBaseClass;
}
}

- (NSString*)sanitizedCustomSuperentity {
NSString *customSuperentity = [self customSuperentity];
if ([customSuperentity hasPrefix:@"."]) {
return [customSuperentity stringByReplacingOccurrencesOfString:@"." withString:@""];
}
return customSuperentity;
}

- (NSString*)forcedCustomBaseClass {
NSString* userInfoCustomBaseClass = [[self userInfo] objectForKey:kCustomBaseClass];
return userInfoCustomBaseClass ? userInfoCustomBaseClass : gCustomBaseClassForced;
Expand Down Expand Up @@ -1220,6 +1229,10 @@ - (int)application:(DDCliApplication*)app runWithArguments:(NSArray*)arguments {
generatedHumanM = [generatedHumanM stringByReplacingOccurrencesOfRegex:searchPattern withString:replacementString];

NSString *entityClassName = [entity managedObjectClassName];
if ([entityClassName.firstLetter compare:@"."] == NSOrderedSame) {
// If default module specified, "MyClass" -> ".MyClass" -> "_MyClass"/"__MyClass"
entityClassName = [entityClassName substringFromIndex:1];
}
entityClassName = [entityClassName stringByReplacingOccurrencesOfString:@"." withString:@"_"];
BOOL machineDirtied = NO;

Expand Down

0 comments on commit 1294723

Please sign in to comment.