Class: MatViews::Admin::RunsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/mat_views/admin/runs_controller.rb

Overview

MatViews::Admin::RunsController


Controller for viewing materialised view run history in the admin UI.

Responsibilities:

  • Provides a list of recent runs (create/refresh/delete) for all definitions.

  • Shows details for an individual run in a Turbo frame/drawer context.

Filters:

  • ‘before_action :ensure_frame` → enforces frame-only access.

  • ‘before_action :set_mat_view_run` → loads and authorizes a single run.

Views:

  • Index renders mat_views/admin/runs/embed_frame partial.

  • Show renders mat_views/admin/runs/embed_show_drawer partial.

Instance Method Summary collapse

Methods included from AuthBridge

#user

Instance Method Details

#indexvoid

This method returns an undefined value.

GET /:lang/admin/runs

Lists all materialised view runs ordered by start time.



37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'app/controllers/mat_views/admin/runs_controller.rb', line 37

def index
  authorize_mat_views!(:read, :mat_views_runs)

  @definitions = MatViews::MatViewDefinition.order(:name).to_a
  @runs = MatViews::MatViewRun.order(started_at: :desc)

  i[mat_view_definition_id operation status].each do |param|
    param_value = params[param]
    next unless param_value.present?

    @runs = @runs.where(param => param_value)
  end
  render 'index', formats: :html, layout: 'mat_views/turbo_frame'
end

#showvoid

This method returns an undefined value.

GET /:lang/admin/runs/:id

Displays details for a single run.



57
58
59
# File 'app/controllers/mat_views/admin/runs_controller.rb', line 57

def show
  render 'show', formats: :html, layout: 'mat_views/turbo_frame'
end