Align relationshipRoutes to use same filtering mechanics as classRoutes and namedRoutes.

This commit is contained in:
Jawwad Ahmad
2012-09-15 11:29:12 -04:00
parent 71e7de56e4
commit 2aaba1461a

View File

@@ -70,10 +70,12 @@ RKRequestMethod const RKRequestMethodAny = RKRequestMethodInvalid;
- (NSArray *)relationshipRoutes
{
NSIndexSet *indexes = [self.routes indexesOfObjectsPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop) {
return [(RKRoute *)obj isRelationshipRoute];
}];
return [self.routes objectsAtIndexes:indexes];
NSMutableArray *routes = [NSMutableArray array];
for (RKRoute *route in self.routes) {
if ([route isRelationshipRoute]) [routes addObject:route];
}
return [NSArray arrayWithArray:routes];
}
- (void)addRoute:(RKRoute *)route