Sha256: 606ed0ace7dc3855c237168fe3472029ca39a5120a32c0588362c0b426444092

Contents?: true

Size: 633 Bytes

Versions: 6

Compression:

Stored size: 633 Bytes

Contents

module RailsWorkflow
  class ErrorsController < ActionController::Base

    def retry
      process = RailsWorkflow::Process.find(permitted_params[:process_id])

      if permitted_params[:operation_id].present?
        operation = Operation.find(permitted_params[:operation_id])
      end

      error = Error.find(permitted_params[:id])
      error.retry

      if operation.present?
        redirect_to process_operation_path(process, operation)
      else
        redirect_to process_path(process)
      end

    end

    protected
    def permitted_params
      params.permit(:process_id, :operation_id, :id)
    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails_workflow-0.3.4 app/controllers/rails_workflow/errors_controller.rb
rails_workflow-0.3.3 app/controllers/rails_workflow/errors_controller.rb
rails_workflow-0.3.2 app/controllers/rails_workflow/errors_controller.rb
rails_workflow-0.3.1 app/controllers/rails_workflow/errors_controller.rb
rails_workflow-0.3.0 app/controllers/rails_workflow/errors_controller.rb
rails_workflow-0.2.2 app/controllers/rails_workflow/errors_controller.rb