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
Merge pull request #14154 from al2o3cr/issue12770

Pass a base relation to build_default_scope when joining