diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-09-04 22:21:47 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-09-04 22:21:47 +0900 |
commit | 5b88bd81f52b454c80c54bef9951bdb8cf607238 (patch) | |
tree | c2258ceecd95eb391b2d54715b49b310cefb5ef5 /app/presenters | |
parent | fa6b9acaf9759c58353f8407ff20a7d02b8edf92 (diff) | |
download | gitlab-ce-5b88bd81f52b454c80c54bef9951bdb8cf607238.tar.gz |
Move trigger_variables to presenter
Diffstat (limited to 'app/presenters')
-rw-r--r-- | app/presenters/ci/build_presenter.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/presenters/ci/build_presenter.rb b/app/presenters/ci/build_presenter.rb index c495c3f39bb..255475e1fe6 100644 --- a/app/presenters/ci/build_presenter.rb +++ b/app/presenters/ci/build_presenter.rb @@ -17,5 +17,16 @@ module Ci "Job is redundant and is auto-canceled by Pipeline ##{auto_canceled_by_id}" end end + + def trigger_variables + return [] unless trigger_request + + @trigger_variables ||= + if pipeline.variables.any? + pipeline.variables.map(&:to_runner_variable) + else + trigger_request.user_variables + end + end end end |