summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-11-21 13:47:18 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-11-21 16:28:23 +0100
commit1d16f137d93576385e403f5caf5f64bfe0b3a647 (patch)
tree7875514900e1e1d329f175d8890e7718f886e38d /app/models
parentc99522f21eed933f6a6b7214ea659e3ab13ef188 (diff)
downloadgitlab-ce-1d16f137d93576385e403f5caf5f64bfe0b3a647.tar.gz
Add deploy chat command [ci skip]
Diffstat (limited to 'app/models')
-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