summaryrefslogtreecommitdiff
path: root/app/models/pages/virtual_domain.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-07-20 15:40:28 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-20 15:40:28 +0000
commitb595cb0c1dec83de5bdee18284abe86614bed33b (patch)
tree8c3d4540f193c5ff98019352f554e921b3a41a72 /app/models/pages/virtual_domain.rb
parent2f9104a328fc8a4bddeaa4627b595166d24671d0 (diff)
downloadgitlab-ce-b595cb0c1dec83de5bdee18284abe86614bed33b.tar.gz
Add latest changes from gitlab-org/gitlab@15-2-stable-eev15.2.0-rc42
Diffstat (limited to 'app/models/pages/virtual_domain.rb')
-rw-r--r--app/models/pages/virtual_domain.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/models/pages/virtual_domain.rb b/app/models/pages/virtual_domain.rb
index 497f67993ae..119cc7fc166 100644
--- a/app/models/pages/virtual_domain.rb
+++ b/app/models/pages/virtual_domain.rb
@@ -2,8 +2,9 @@
module Pages
class VirtualDomain
- def initialize(projects, trim_prefix: nil, domain: nil)
+ def initialize(projects:, cache: nil, trim_prefix: nil, domain: nil)
@projects = projects
+ @cache = cache
@trim_prefix = trim_prefix
@domain = domain
end
@@ -27,8 +28,12 @@ module Pages
paths.sort_by(&:prefix).reverse
end
+ def cache_key
+ @cache_key ||= cache&.cache_key
+ end
+
private
- attr_reader :projects, :trim_prefix, :domain
+ attr_reader :projects, :trim_prefix, :domain, :cache
end
end