Replace direct use of Gitlab::SQL::Union with a "from_union" method Closes #51307 See merge request gitlab-org/gitlab-ce!21672