Fixed undefined modelClass when using polymorphic relations