patch to allow for polymorphic models