Commit 4b1bdc31 authored by Thong Kuah's avatar Thong Kuah

Resolve conflict in lib/gitlab/group_hierarchy.rb

parent 62f5558f
......@@ -36,15 +36,12 @@ module Gitlab
# rubocop: disable CodeReuse/ActiveRecord
def ancestors(upto: nil, hierarchy_order: nil)
base_and_ancestors(upto: upto, hierarchy_order: hierarchy_order).where.not(id: ancestors_base.select(:id))
<<<<<<< HEAD
end
# rubocop: enable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord
def roots
base_and_ancestors.where(namespaces: { parent_id: nil })
=======
>>>>>>> upstream/master
end
# rubocop: enable CodeReuse/ActiveRecord
......@@ -130,17 +127,10 @@ module Gitlab
def base_and_ancestors_cte(stop_id = nil, hierarchy_order = nil)
cte = SQL::RecursiveCTE.new(:base_and_ancestors)
depth_column = :depth
<<<<<<< HEAD
base_query = ancestors_base.except(:order)
base_query = base_query.select("1 as #{depth_column}", groups_table[Arel.star]) if hierarchy_order
=======
base_query = ancestors_base.except(:order)
base_query = base_query.select("1 as #{depth_column}", groups_table[Arel.star]) if hierarchy_order
>>>>>>> upstream/master
cte << base_query
# Recursively get all the ancestors of the base set.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment