gitlab-org--gitlab-foss/app/presenters/ci/build_metadata_presenter.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
566 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Ci
class BuildMetadataPresenter < Gitlab::View::Presenter::Delegated
TIMEOUT_SOURCES = {
unknown_timeout_source: nil,
project_timeout_source: 'project',
runner_timeout_source: 'runner',
job_timeout_source: 'job'
}.freeze
presents ::Ci::BuildMetadata, as: :metadata
delegator_override :timeout_source
def timeout_source
return unless metadata.timeout_source?
TIMEOUT_SOURCES[metadata.timeout_source.to_sym] ||
2018-03-01 13:43:10 -05:00
metadata.timeout_source
end
end
end