Class: CoPlan::AutomatedReviewsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/coplan/automated_reviews_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

controller_path

Instance Method Details

#createObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/coplan/automated_reviews_controller.rb', line 6

def create
  authorize!(@plan, :update?)

  AutomatedReviewJob.perform_later(
    plan_id: @plan.id,
    reviewer_id: @reviewer.id,
    plan_version_id: @plan.current_plan_version_id,
    triggered_by: current_user
  )

  redirect_to plan_path(@plan), notice: "#{@reviewer.name} review queued."
end