Add support for embedded polymorphic belongsTo

Fixes #2265.