Add support for embedded polymorphic belongsTo

Fixes #2265.
To be honest, I don't know. I think there are some inconsistencies in how this currently works, would love to dig deeper and iron out what's really correct.