Fix detecting resource name with inhereted resources

When controller has custom resource_class, method parent? returns wrong value.