2019-02-02 18:00:53 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
class CommitPresenter < Gitlab::View::Presenter::Delegated
|
|
|
|
include GlobalID::Identification
|
|
|
|
|
2019-02-02 18:00:53 +05:30
|
|
|
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
|
2019-09-30 21:07:59 +05:30
|
|
|
|
|
|
|
def web_url
|
|
|
|
Gitlab::UrlBuilder.new(commit).url
|
|
|
|
end
|
2019-02-02 18:00:53 +05:30
|
|
|
end
|