Class: CommitPresenter
- Inherits:
-
Gitlab::View::Presenter::Delegated
- Object
- SimpleDelegator
- Gitlab::View::Presenter::Delegated
- CommitPresenter
- Includes:
- GlobalID::Identification
- Defined in:
- app/presenters/commit_presenter.rb
Instance Method Summary collapse
Methods inherited from Gitlab::View::Presenter::Delegated
Methods included from Gitlab::Utils::DelegatorOverride
#delegator_override, #delegator_override_with, #delegator_target, validator, validators, verify!
Methods included from Gitlab::View::Presenter::Base
#__subject__, #can?, #declarative_policy_delegate, #is_a?, #present, #url_builder, #web_path, #web_url
Methods included from Gitlab::Allowable
Methods included from Gitlab::Routing
add_helpers, includes_helpers, redirect_legacy_paths, url_helpers
Constructor Details
This class inherits a constructor from Gitlab::View::Presenter::Delegated
Instance Method Details
#any_pipelines? ⇒ Boolean
14 15 16 17 18 |
# File 'app/presenters/commit_presenter.rb', line 14 def any_pipelines? return false unless can?(current_user, :read_pipeline, commit.project) commit.pipelines.any? end |
#signature_html ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'app/presenters/commit_presenter.rb', line 20 def signature_html return unless commit.has_signature? ApplicationController.renderer.render( 'projects/commit/_signature', locals: { signature: commit.signature }, layout: false, formats: [:html] ) end |
#status_for(ref) ⇒ Object
8 9 10 11 12 |
# File 'app/presenters/commit_presenter.rb', line 8 def status_for(ref) return unless can?(current_user, :read_commit_status, commit.project) commit.latest_pipeline(ref)&.detailed_status(current_user) end |