summaryrefslogtreecommitdiff
path: root/app/controllers/runners_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/runners_controller.rb')
-rw-r--r--app/controllers/runners_controller.rb18
1 files changed, 17 insertions, 1 deletions
diff --git a/app/controllers/runners_controller.rb b/app/controllers/runners_controller.rb
index 395d376..4780069 100644
--- a/app/controllers/runners_controller.rb
+++ b/app/controllers/runners_controller.rb
@@ -1,7 +1,7 @@
class RunnersController < ApplicationController
before_filter :authenticate_user!
before_filter :project
- before_filter :set_runner, only: [:edit, :update, :destroy]
+ before_filter :set_runner, only: [:edit, :update, :destroy, :pause, :resume]
before_filter :authorize_access_project!
before_filter :authorize_manage_project!
@@ -33,6 +33,22 @@ class RunnersController < ApplicationController
redirect_to project_runners_path(@project)
end
+ def resume
+ if @runner.update_attributes(active: true)
+ redirect_to project_runners_path(@project, @runner), notice: 'Runner was successfully updated.'
+ else
+ redirect_to project_runners_path(@project, @runner), alert: 'Runner was not updated.'
+ end
+ end
+
+ def pause
+ if @runner.update_attributes(active: false)
+ redirect_to project_runners_path(@project, @runner), notice: 'Runner was successfully updated.'
+ else
+ redirect_to project_runners_path(@project, @runner), alert: 'Runner was not updated.'
+ end
+ end
+
protected
def project