Class: Deployments::DeploymentPresenter

Inherits:
Gitlab::View::Presenter::Delegated show all
Defined in:
app/presenters/deployments/deployment_presenter.rb

Instance Method Summary collapse

Methods inherited from Gitlab::View::Presenter::Delegated

#initialize

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?, #path_with_line_numbers, #present, #url_builder, #web_url

Methods included from Gitlab::Allowable

#can?, #can_all?, #can_any?

Methods included from Gitlab::Routing

includes_helpers, redirect_legacy_paths, url_helpers

Constructor Details

This class inherits a constructor from Gitlab::View::Presenter::Delegated

Instance Method Details

#ref_pathObject



23
24
25
# File 'app/presenters/deployments/deployment_presenter.rb', line 23

def ref_path
  project_tree_path(project, id: ref)
end

#tagsObject

Note: this returns the path key as ‘tags/tag_name’ but it is used as a URL in the UI



11
12
13
14
15
16
17
18
19
20
# File 'app/presenters/deployments/deployment_presenter.rb', line 11

def tags
  super.map do |tag|
    name = tag.delete_prefix(Gitlab::Git::TAG_REF_PREFIX)
    {
      name: name,
      path: tag.delete_prefix('refs/'),
      web_path: project_tag_path(project, id: name)
    }
  end
end

#web_pathObject



27
28
29
# File 'app/presenters/deployments/deployment_presenter.rb', line 27

def web_path
  project_environment_deployment_path(project, environment, deployment)
end