Class: Dscf::Credit::FacilitatorsController

Inherits:
ApplicationController show all
Includes:
Dscf::Core::Common, Dscf::Core::ReviewableController
Defined in:
app/controllers/dscf/credit/facilitators_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



6
7
8
9
10
11
12
# File 'app/controllers/dscf/credit/facilitators_controller.rb', line 6

def create
  super do
    facilitator = @clazz.new(model_params)
    facilitator.reviews.build(status: "draft", context: "default")
    facilitator
  end
end

#updateObject



14
15
16
17
18
19
20
21
22
# File 'app/controllers/dscf/credit/facilitators_controller.rb', line 14

def update
  unless @obj.editable?
    return render_error(
      errors: [ "Cannot update facilitator after submission. Use modification request workflow instead." ],
      status: :unprocessable_entity
    )
  end
  super
end