summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/ci/build.rb4
-rw-r--r--app/models/ci/pipeline.rb4
-rw-r--r--app/models/deployment.rb4
-rw-r--r--app/views/projects/ci/pipelines/_pipeline.html.haml6
-rw-r--r--app/views/projects/deployments/_playable.html.haml6
5 files changed, 10 insertions, 14 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 81feca0088f..a05b3f43f97 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -96,10 +96,6 @@ module Ci
self.when == 'manual'
end
- def playable_actions
- pipeline.playable_actions
- end
-
def playable?
project.builds_enabled? && commands.present? && manual?
end
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 5aefe1d1694..de9c74194ac 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -65,8 +65,8 @@ module Ci
!tag?
end
- def playable_actions
- builds.manual_actions.latest
+ def manual_actions
+ builds.latest.manual_actions
end
def retryable?
diff --git a/app/models/deployment.rb b/app/models/deployment.rb
index 44dfb67552e..aa1f7e462d2 100644
--- a/app/models/deployment.rb
+++ b/app/models/deployment.rb
@@ -33,7 +33,7 @@ class Deployment < ActiveRecord::Base
project.repository.keep_around(self.sha)
end
- def playable_actions
- deployable.try(:playable_actions)
+ def manual_actions
+ deployable.try(:manual_actions)
end
end
diff --git a/app/views/projects/ci/pipelines/_pipeline.html.haml b/app/views/projects/ci/pipelines/_pipeline.html.haml
index 1285fce4930..b9adc920ea6 100644
--- a/app/views/projects/ci/pipelines/_pipeline.html.haml
+++ b/app/views/projects/ci/pipelines/_pipeline.html.haml
@@ -57,8 +57,8 @@
%td.pipeline-actions
.controls.hidden-xs.pull-right
- artifacts = pipeline.builds.latest.select { |b| b.artifacts? }
- - playable = pipeline.playable_actions
- - if artifacts.present? || playable.any?
+ - actions = pipeline.manual_actions
+ - if artifacts.present? || actions.any?
.btn-group.inline
- if playable.any?
.btn-group
@@ -69,7 +69,7 @@
%li
= link_to play_namespace_project_build_path(@project.namespace, @project, build), rel: 'nofollow' do
= icon("play")
- %span= playable.name.titleize
+ %span= actions.name.titleize
- if artifacts.present?
.btn-group
%a.dropdown-toggle.btn.btn-default.build-artifacts{type: 'button', 'data-toggle' => 'dropdown'}
diff --git a/app/views/projects/deployments/_playable.html.haml b/app/views/projects/deployments/_playable.html.haml
index 02e4fb7974e..4bff21ce7a5 100644
--- a/app/views/projects/deployments/_playable.html.haml
+++ b/app/views/projects/deployments/_playable.html.haml
@@ -1,5 +1,5 @@
-- playable = deployment.playable_actions
-- if playable.any?
+- actions = deployment.manual_actions
+- if actions.any?
.btn-group.inline
.btn-group
%a.dropdown-toggle.btn.btn-default{type: 'button', 'data-toggle' => 'dropdown'}
@@ -9,4 +9,4 @@
%li
= link_to play_namespace_project_build_path(@project.namespace, @project, build), rel: 'nofollow' do
= icon("play")
- %span= playable.name.titleize
+ %span= actions.name.titleize