Class: Protege::ResponsibilityRunsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Protege::ResponsibilityRunsController
- Defined in:
- app/controllers/protege/responsibility_runs_controller.rb
Overview
Surfaces individual runs of a responsibility — the Loop layer's run records. Creating a run is how the dashboard's "Run now" works: dispatching a responsibility immediately, modelled RESTfully as POSTing a new run rather than a custom action.
Instance Method Summary collapse
-
#create ⇒ void
Dispatch a responsibility now, recording a pending run and enqueuing its job.
-
#show ⇒ void
Show one run's outcome — status, timing, and any failure detail.
Instance Method Details
#create ⇒ void
This method returns an undefined value.
Dispatch a responsibility now, recording a pending run and enqueuing its job. Serves
POST /responsibility_runs.
14 15 16 17 18 19 20 |
# File 'app/controllers/protege/responsibility_runs_controller.rb', line 14 def create responsibility = Responsibility.find(run_params[:responsibility_id]) @run = responsibility.dispatch! redirect_to responsibility_run_path(@run), notice: 'Run enqueued.' end |
#show ⇒ void
This method returns an undefined value.
Show one run's outcome — status, timing, and any failure detail. Serves
GET /responsibility_runs/:id.
26 27 28 |
# File 'app/controllers/protege/responsibility_runs_controller.rb', line 26 def show @responsibility = @run.responsibility end |