summaryrefslogtreecommitdiff
path: root/app/presenters
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2019-06-28 08:30:29 +0100
committerPhil Hughes <me@iamphill.com>2019-06-28 08:30:29 +0100
commitd78f7ceac94abe0e8318c6472fc5f7967325a74f (patch)
tree831839462f28797c52b8f2452ce3c659c1874b9a /app/presenters
parent80735a2d4b3615e5bd94ea6032b304b58dd2c357 (diff)
downloadgitlab-ce-d78f7ceac94abe0e8318c6472fc5f7967325a74f.tar.gz
Added commit type to tree GraphQL type
Diffstat (limited to 'app/presenters')
-rw-r--r--app/presenters/commit_presenter.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/presenters/commit_presenter.rb b/app/presenters/commit_presenter.rb
index 05adbe1d4f5..fc9853733c1 100644
--- a/app/presenters/commit_presenter.rb
+++ b/app/presenters/commit_presenter.rb
@@ -1,6 +1,8 @@
# frozen_string_literal: true
-class CommitPresenter < Gitlab::View::Presenter::Simple
+class CommitPresenter < Gitlab::View::Presenter::Delegated
+ include GlobalID::Identification
+
presents :commit
def status_for(ref)
@@ -10,4 +12,8 @@ class CommitPresenter < Gitlab::View::Presenter::Simple
def any_pipelines?
can?(current_user, :read_pipeline, commit.project) && commit.pipelines.any?
end
+
+ def web_url
+ Gitlab::UrlBuilder.new(commit).url
+ end
end