summaryrefslogtreecommitdiff
path: root/app/presenters
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-09-29 11:14:00 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-10-05 11:35:27 +0200
commit90fa4e7e54dc4f272b5f6a853f07b5e57a2a6cc4 (patch)
tree2cb409163bbb0d0ea0a21f0726c4ea78f656a039 /app/presenters
parent29f59bdf6f91fd2250fe237a320865e5c836f001 (diff)
downloadgitlab-ce-90fa4e7e54dc4f272b5f6a853f07b5e57a2a6cc4.tar.gz
Move part of pipeline presenter to main CE file
Diffstat (limited to 'app/presenters')
-rw-r--r--app/presenters/ci/pipeline_presenter.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/presenters/ci/pipeline_presenter.rb b/app/presenters/ci/pipeline_presenter.rb
index a542bdd8295..5e393e95c80 100644
--- a/app/presenters/ci/pipeline_presenter.rb
+++ b/app/presenters/ci/pipeline_presenter.rb
@@ -1,6 +1,13 @@
module Ci
class PipelinePresenter < Gitlab::View::Presenter::Delegated
- presents :pipeline
+ FAILURE_REASONS = {}
+
+ def failure_reason
+ return unless pipeline.failure_reason?
+
+ FAILURE_REASONS[pipeline.failure_reason.to_sym] ||
+ pipeline.failure_reason
+ end
def status_title
if auto_canceled?