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: 05adbe1d4f546caf6a228a2f20d4881faca52534 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

class CommitPresenter < Gitlab::View::Presenter::Simple
  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
end