diff options
Diffstat (limited to 'app/presenters/ci/build_metadata_presenter.rb')
-rw-r--r-- | app/presenters/ci/build_metadata_presenter.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/presenters/ci/build_metadata_presenter.rb b/app/presenters/ci/build_metadata_presenter.rb new file mode 100644 index 00000000000..e80eb19ea19 --- /dev/null +++ b/app/presenters/ci/build_metadata_presenter.rb @@ -0,0 +1,20 @@ +module Ci + class BuildMetadataPresenter < Gitlab::View::Presenter::Delegated + + TIMEOUT_SOURCES = { + unknown_timeout_source: nil, + project_timeout_source: 'project', + runner_timeout_source: 'runner' + }.freeze + + presents :metadata + + def timeout_source + return unless metadata.timeout_source? + + TIMEOUT_SOURCES[metadata.timeout_source.to_sym] || + metadata.timeout_source + end + + end +end |