Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r--app/models/namespace.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index f9b53b2b70a..af50293a179 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -250,7 +250,9 @@ class Namespace < ApplicationRecord
end
def root_ancestor
- self_and_ancestors.reorder(nil).find_by(parent_id: nil)
+ strong_memoize(:root_ancestor) do
+ self_and_ancestors.reorder(nil).find_by(parent_id: nil)
+ end
end
def subgroup?
@@ -291,6 +293,10 @@ class Namespace < ApplicationRecord
end
end
+ def aggregation_scheduled?
+ aggregation_schedule.present?
+ end
+
private
def parent_changed?