@@ -54,13 +54,13 @@ - (NSArray*)entitiesWithACustomSubclassInConfiguration:(NSString*)configuration_
54
54
nsenumerate (allEntities, NSEntityDescription , entity) {
55
55
NSString *entityClassName = [entity managedObjectClassName ];
56
56
57
- if ([entityClassName isEqualToString: @" NSManagedObject" ] || [entityClassName isEqualToString: @" " ] || [entityClassName isEqualToString: gCustomBaseClass ]){
57
+ if ([entity hasCustomClass ]){
58
+ [result addObject: entity];
59
+ } else {
58
60
if (verbose_) {
59
61
ddprintf (@" skipping entity %@ (%@ ) because it doesn't use a custom subclass.\n " ,
60
62
entity.name , entityClassName);
61
63
}
62
- } else {
63
- [result addObject: entity];
64
64
}
65
65
}
66
66
@@ -77,6 +77,15 @@ - (BOOL)hasCustomBaseCaseImport {
77
77
- (NSString *)baseClassImport {
78
78
return gCustomBaseClassImport ;
79
79
}
80
+
81
+ - (BOOL )hasCustomClass {
82
+ NSString *entityClassName = [self managedObjectClassName ];
83
+ BOOL result = !([entityClassName isEqualToString: @" NSManagedObject" ]
84
+ || [entityClassName isEqualToString: @" " ]
85
+ || [entityClassName isEqualToString: gCustomBaseClass ]);
86
+ return result;
87
+ }
88
+
80
89
- (BOOL )hasSuperentity {
81
90
NSEntityDescription *superentity = [self superentity ];
82
91
if (superentity) {
@@ -90,14 +99,15 @@ - (BOOL)hasCustomSuperentity {
90
99
if (!forcedBaseClass) {
91
100
NSEntityDescription *superentity = [self superentity ];
92
101
if (superentity) {
93
- return YES ;
102
+ return [superentity hasCustomClass ] ? YES : NO ;
94
103
} else {
95
104
return gCustomBaseClass ? YES : NO ;
96
105
}
97
106
} else {
98
107
return YES ;
99
108
}
100
109
}
110
+
101
111
- (NSString *)customSuperentity {
102
112
NSString *forcedBaseClass = [self forcedCustomBaseClass ];
103
113
if (!forcedBaseClass) {
0 commit comments