Fix detecting resource name with inhereted resources

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