summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-06 18:09:37 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-06 18:09:37 +0000
commit495c22d1245b6212b21b7379a542df73dfa77206 (patch)
tree5f0f82dd6c8c4fe1c4bd411f9e398b1a6eaaa69f /app/models
parentf3b1e07903a7f509b11ad7cf188fac46d98f77f6 (diff)
downloadgitlab-ce-495c22d1245b6212b21b7379a542df73dfa77206.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/concerns/has_repository.rb2
-rw-r--r--app/models/group.rb4
-rw-r--r--app/models/personal_snippet.rb4
-rw-r--r--app/models/project.rb4
-rw-r--r--app/models/project_snippet.rb4
-rw-r--r--app/models/project_wiki.rb4
6 files changed, 5 insertions, 17 deletions
diff --git a/app/models/concerns/has_repository.rb b/app/models/concerns/has_repository.rb
index 35faa87e876..6a09741b903 100644
--- a/app/models/concerns/has_repository.rb
+++ b/app/models/concerns/has_repository.rb
@@ -110,7 +110,7 @@ module HasRepository
end
def web_url(only_path: nil)
- raise NotImplementedError
+ Gitlab::UrlBuilder.build(self, only_path: only_path)
end
def repository_size_checker
diff --git a/app/models/group.rb b/app/models/group.rb
index 5e6e3032251..203ed1694b7 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -172,8 +172,8 @@ class Group < Namespace
"#{self.class.reference_prefix}#{full_path}"
end
- def web_url
- Gitlab::Routing.url_helpers.group_canonical_url(self)
+ def web_url(only_path: nil)
+ Gitlab::UrlBuilder.build(self, only_path: only_path)
end
def human_name
diff --git a/app/models/personal_snippet.rb b/app/models/personal_snippet.rb
index 5940265b17a..1b5be8698b1 100644
--- a/app/models/personal_snippet.rb
+++ b/app/models/personal_snippet.rb
@@ -2,8 +2,4 @@
class PersonalSnippet < Snippet
include WithUploads
-
- def web_url(only_path: nil)
- Gitlab::Routing.url_helpers.snippet_url(self, only_path: only_path)
- end
end
diff --git a/app/models/project.rb b/app/models/project.rb
index eb4412decba..15b8d5db214 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1121,10 +1121,6 @@ class Project < ApplicationRecord
end
end
- def web_url(only_path: nil)
- Gitlab::Routing.url_helpers.project_url(self, only_path: only_path)
- end
-
def readme_url
readme_path = repository.readme_path
if readme_path
diff --git a/app/models/project_snippet.rb b/app/models/project_snippet.rb
index 6045ec71c6e..ffb08e10f1f 100644
--- a/app/models/project_snippet.rb
+++ b/app/models/project_snippet.rb
@@ -5,8 +5,4 @@ class ProjectSnippet < Snippet
validates :project, presence: true
validates :secret, inclusion: { in: [false] }
-
- def web_url(only_path: nil)
- Gitlab::Routing.url_helpers.project_snippet_url(project, self, only_path: only_path)
- end
end
diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb
index f0967b87345..4b888648b9e 100644
--- a/app/models/project_wiki.rb
+++ b/app/models/project_wiki.rb
@@ -44,8 +44,8 @@ class ProjectWiki
# @deprecated use full_path when you need it for an URL route or disk_path when you want to point to the filesystem
alias_method :path_with_namespace, :full_path
- def web_url
- Gitlab::Routing.url_helpers.project_wiki_url(@project, :home)
+ def web_url(only_path: nil)
+ Gitlab::UrlBuilder.build(self, only_path: only_path)
end
def url_to_repo