summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-04-13 11:25:42 +0200
committerRémy Coutable <remy@rymai.me>2016-04-13 16:07:04 +0200
commit02cfbf0db5dda8ca86f4811e5d5cb055a8cc5cfb (patch)
tree2b37a9ba2144bffc8544847eb157c4dc298c2c17 /app/models/commit.rb
parentbbf49ffca1c1be65567afa76961d176e57d40150 (diff)
downloadgitlab-ce-02cfbf0db5dda8ca86f4811e5d5cb055a8cc5cfb.tar.gz
Refactor and expose only Gitlab::UrlBuilder.build(record)simplify-gitlab-url_builder-15202
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 11ecfcace14..d1f07ccd55c 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -154,7 +154,7 @@ class Commit
id: id,
message: safe_message,
timestamp: committed_date.xmlschema,
- url: commit_url,
+ url: Gitlab::UrlBuilder.build(self),
author: {
name: author_name,
email: author_email
@@ -168,10 +168,6 @@ class Commit
data
end
- def commit_url
- project.present? ? "#{Gitlab.config.gitlab.url}/#{project.path_with_namespace}/commit/#{id}" : ""
- end
-
# Discover issues should be closed when this commit is pushed to a project's
# default branch.
def closes_issues(current_user = self.committer)