From 0aa232704c5df68f0ed111e355a07cfaf241e8a9 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 18 Oct 2016 12:02:50 +0200 Subject: Add `stop!` to `environment` --- app/models/environment.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/models/environment.rb') 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 -- cgit v1.2.1