diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2019-06-28 10:02:57 +0000 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2019-06-28 10:02:57 +0000 |
commit | 2321b337f1487031e2cab8e1a4e778f3aaf8e2da (patch) | |
tree | 09ac0a7fe65e4da93f873e4b8cf02b57cd359791 /app/presenters | |
parent | 1012cfb0b780bc9348a8478a66af2a337a69b0f6 (diff) | |
parent | d78f7ceac94abe0e8318c6472fc5f7967325a74f (diff) | |
download | gitlab-ce-2321b337f1487031e2cab8e1a4e778f3aaf8e2da.tar.gz |
Merge branch 'graphql-tree-last-commit' into 'master'
Added commit type to tree GraphQL type
See merge request gitlab-org/gitlab-ce!29412
Diffstat (limited to 'app/presenters')
-rw-r--r-- | app/presenters/commit_presenter.rb | 8 |
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 |