summaryrefslogtreecommitdiff
path: root/app/presenters/commit_presenter.rb
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