Fixes #7647: Added support for external registries

It's a huge pain to go from a habtm to a has_many :through if you do need to add some logic/fields to the intermediate object.