debian-mirror-gitlab/app/presenters/deployments/deployment_presenter.rb

21 lines
474 B
Ruby
Raw Normal View History

2022-10-11 01:57:18 +05:30
# frozen_string_literal: true
module Deployments
class DeploymentPresenter < Gitlab::View::Presenter::Delegated
presents ::Deployment, as: :deployment
delegator_override :tags
2023-01-13 00:05:48 +05:30
# Note: this returns the path key as 'tags/tag_name' but it is used as a URL in the UI
2022-10-11 01:57:18 +05:30
def tags
super.map do |tag|
{
2023-01-13 00:05:48 +05:30
name: tag.delete_prefix(Gitlab::Git::TAG_REF_PREFIX),
path: tag.delete_prefix('refs/')
2022-10-11 01:57:18 +05:30
}
end
end
end
end