Sha256: a978d7d94559ff6b7b3bdce24984f392891f742c5014a6e075ba4cce8c9a8d8f
Contents?: true
Size: 962 Bytes
Versions: 20
Compression:
Stored size: 962 Bytes
Contents
module Fiona7 class WorkflowController < ActionController::Base def edit workflow_action('edit') end def take workflow_action('take') end def forward workflow_action('forward') end def commit workflow_action('commit') end def sign workflow_action('sign') end def reject workflow_action('reject') end protected def workflow_action(action) @obj = WriteObj.find(params[:id]) @comment = params[:comment] if action == 'edit' # TODO: this should be implemented in reactor. @obj.edit!(@comment) else @obj.workflow.send(:"#{action}!", @comment) end render json: {} rescue => e Rails.logger.error("Error #{e.inspect} when executing workflow operation on #{@obj.id} with comment=#{@comment}") render json: {message: e.message, message_for_editor: e.message}, status: 412 end end end
Version data entries
20 entries across 20 versions & 1 rubygems