diff --git a/app/controllers/custom_workflows_controller.rb b/app/controllers/custom_workflows_controller.rb index 5346136..592f56a 100644 --- a/app/controllers/custom_workflows_controller.rb +++ b/app/controllers/custom_workflows_controller.rb @@ -66,9 +66,12 @@ class CustomWorkflowsController < ApplicationController def change_status respond_to do |format| - @workflow.update_attributes(:active => params[:active]) - flash[:notice] = l(:notice_successful_status_change) - format.html { redirect_to(custom_workflows_path) } + if @workflow.update_attributes(:active => params[:active]) + flash[:notice] = l(:notice_successful_status_change) + format.html { redirect_to(custom_workflows_path) } + else + format.html { render :action => :edit } + end end end diff --git a/app/models/custom_workflow.rb b/app/models/custom_workflow.rb index ffe99a8..6d7cb7c 100644 --- a/app/models/custom_workflow.rb +++ b/app/models/custom_workflow.rb @@ -107,7 +107,7 @@ class CustomWorkflow < ActiveRecord::Base end def validate_syntax - return unless respond_to? :observable + return unless respond_to?(:observable) && active? case observable when 'shared' CustomWorkflow.run_shared_code(self)