diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-10-06 13:10:50 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-10-06 13:16:34 +0200 |
commit | 3f85c3ef1629870e22f6a676585e8de80e5120c3 (patch) | |
tree | 141a1ef7d8fb0eaa79e203331d36671a60993070 /app/models/deployment.rb | |
parent | 2c01b19f8f55c7105506cdbe964d24d0a3c6dfc4 (diff) | |
download | gitlab-ce-3f85c3ef1629870e22f6a676585e8de80e5120c3.tar.gz |
Initial support for closing environments
Diffstat (limited to 'app/models/deployment.rb')
-rw-r--r-- | app/models/deployment.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/models/deployment.rb b/app/models/deployment.rb index 82b27b78229..070c76339b1 100644 --- a/app/models/deployment.rb +++ b/app/models/deployment.rb @@ -77,6 +77,19 @@ class Deployment < ActiveRecord::Base take end + def close_action + return nil unless manual_actions + + @close_action ||= + manual_actions.find do |manual_action| + manual_action.try(:closes_environment?, deployable.environment) + end + end + + def closeable? + close_action.present? + end + private def ref_path |