Replace and remove EE ObjectHierarchy
There's an EE specific version of ObjectHierarchy which only includes a roots method. There's no need for this to be EE specific. We also have new ways to perform the query.
https://gitlab.com/gitlab-org/gitlab/blob/master/ee/lib/ee/gitlab/object_hierarchy.rb#L7
# frozen_string_literal: true
module EE
module Gitlab
module ObjectHierarchy
# rubocop: disable CodeReuse/ActiveRecord
def roots
base_and_ancestors.where(namespaces: { parent_id: nil })
end
# rubocop: enable CodeReuse/ActiveRecord
end
end
end
We should:
-
Replace uses of https://gitlab.com/gitlab-org/gitlab/blob/master/ee/lib/ee/gitlab/object_hierarchy.rb#L7 with the rootsscope. -
Remove https://gitlab.com/gitlab-org/gitlab/blob/master/ee/lib/ee/gitlab/object_hierarchy.rb#L7