Fix tests
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
module WorkflowScoped
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
before_action :set_workflow
|
||||
end
|
||||
|
||||
private
|
||||
def set_workflow
|
||||
@workflow = Workflow.find(params[:workflow_id])
|
||||
end
|
||||
end
|
||||
@@ -1,36 +0,0 @@
|
||||
class Workflows::StagesController < ApplicationController
|
||||
include WorkflowScoped
|
||||
|
||||
before_action :set_stage, only: %i[ edit update destroy ]
|
||||
|
||||
def new
|
||||
@stage = @workflow.stages.new
|
||||
end
|
||||
|
||||
def create
|
||||
@stage = @workflow.stages.create! stage_params
|
||||
redirect_to @workflow
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def update
|
||||
@stage.update! stage_params
|
||||
redirect_to @workflow
|
||||
end
|
||||
|
||||
def destroy
|
||||
@stage.destroy
|
||||
redirect_to @workflow
|
||||
end
|
||||
|
||||
private
|
||||
def set_stage
|
||||
@stage = @workflow.stages.find params[:id]
|
||||
end
|
||||
|
||||
def stage_params
|
||||
params.require(:workflow_stage).permit(:name, :color)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user