diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-10-18 12:02:50 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-10-18 12:02:50 +0200 |
commit | 0aa232704c5df68f0ed111e355a07cfaf241e8a9 (patch) | |
tree | e8e91070b0cde623325f6af596d9482ba0681cc6 /app/models/environment.rb | |
parent | 66ff67b063f2c8d06f40625595c4208c33ffd1f1 (diff) | |
download | gitlab-ce-0aa232704c5df68f0ed111e355a07cfaf241e8a9.tar.gz |
Add `stop!` to `environment`
Diffstat (limited to 'app/models/environment.rb')
-rw-r--r-- | app/models/environment.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb index ff55e751f70..d575f1dc73a 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -88,4 +88,10 @@ class Environment < ActiveRecord::Base def stoppable? available? && stop_action.present? end + + def stop!(current_user) + return unless stoppable? + + stop_action.play(current_user) + end end |