diff options
Diffstat (limited to 'app/models/clusters/cluster.rb')
-rw-r--r-- | app/models/clusters/cluster.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/clusters/cluster.rb b/app/models/clusters/cluster.rb index a7943f8cf04..448f6ee6388 100644 --- a/app/models/clusters/cluster.rb +++ b/app/models/clusters/cluster.rb @@ -94,7 +94,8 @@ module Clusters end def self.ancestor_clusters_for_clusterable(clusterable, hierarchy_order: :asc) - hierarchy_groups = clusterable.ancestors_upto(hierarchy_order: hierarchy_order) + hierarchy_groups = clusterable.ancestors_upto(hierarchy_order: hierarchy_order).eager_load(:clusters) + hierarchy_groups = hierarchy_groups.merge(current_scope) if current_scope hierarchy_groups.flat_map do |group| group.clusters |