Allow inheritance when checking model class on a relation