Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-11-21 15:47:18 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2016-11-21 18:28:23 +0300
commit1d16f137d93576385e403f5caf5f64bfe0b3a647 (patch)
tree7875514900e1e1d329f175d8890e7718f886e38d /app/models/environment.rb
parentc99522f21eed933f6a6b7214ea659e3ab13ef188 (diff)
Add deploy chat command [ci skip]
Diffstat (limited to 'app/models/environment.rb')
-rw-r--r--app/models/environment.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb
index 5278efd71d2..e6dd7717e46 100644
--- a/app/models/environment.rb
+++ b/app/models/environment.rb
@@ -19,7 +19,7 @@ class Environment < ActiveRecord::Base
allow_nil: true,
addressable_url: true
- delegate :stop_action, to: :last_deployment, allow_nil: true
+ delegate :stop_action, :manual_actions, to: :last_deployment, allow_nil: true
scope :available, -> { with_state(:available) }
scope :stopped, -> { with_state(:stopped) }
@@ -99,4 +99,12 @@ class Environment < ActiveRecord::Base
stop
stop_action.play(current_user)
end
+
+ def actions_for(environment)
+ return [] unless manual_actions
+
+ manual_actions.select |action|
+ action.expanded_environment_name = environment
+ end
+ end
end