Pass a base relation to build_default_scope when joining

This allows the default scope to be built using the current table alias.
Resolves #12770