Welcome to mirror list, hosted at ThFree Co, Russian Federation.

commit_presenter.rb « presenters « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fc9853733c1465e471684cd723018ebbc4feb236 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class CommitPresenter < Gitlab::View::Presenter::Delegated
  include GlobalID::Identification

  presents :commit

  def status_for(ref)
    can?(current_user, :read_commit_status, commit.project) && commit.status(ref)
  end

  def any_pipelines?
    can?(current_user, :read_pipeline, commit.project) && commit.pipelines.any?
  end

  def web_url
    Gitlab::UrlBuilder.new(commit).url
  end
end