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:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-17 19:05:49 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-17 19:05:49 +0300
commit43a25d93ebdabea52f99b05e15b06250cd8f07d7 (patch)
treedceebdc68925362117480a5d672bcff122fb625b /app/models/project_wiki.rb
parent20c84b99005abd1c82101dfeff264ac50d2df211 (diff)
Add latest changes from gitlab-org/gitlab@16-0-stable-eev16.0.0-rc42
Diffstat (limited to 'app/models/project_wiki.rb')
-rw-r--r--app/models/project_wiki.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb
index ffffa803011..e64892dfa03 100644
--- a/app/models/project_wiki.rb
+++ b/app/models/project_wiki.rb
@@ -12,6 +12,13 @@ class ProjectWiki < Wiki
container.disk_path + '.wiki'
end
+ override :create_wiki_repository
+ def create_wiki_repository
+ super
+
+ track_wiki_repository
+ end
+
override :after_wiki_activity
def after_wiki_activity
# Update activity columns, this is done synchronously to avoid
@@ -28,6 +35,16 @@ class ProjectWiki < Wiki
# the activity columns for Git pushes as well.
after_wiki_activity
end
+
+ private
+
+ def track_wiki_repository
+ return unless ::Gitlab::Database.read_write?
+ return if container.wiki_repository
+
+ # This is the ActiveRecord auto-generated method for a Project's has_one :wiki_repository
+ container.create_wiki_repository!
+ end
end
# TODO: Remove this once we implement ES support for group wikis.