Class: Moderate::TransparencyReportsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/moderate/transparency_reports_controller.rb

Overview

Public aggregate transparency report for moderation intake, decisions, appeals, and automated flags.

Instance Method Summary collapse

Instance Method Details

#showObject



9
10
11
12
13
14
15
16
# File 'app/controllers/moderate/transparency_reports_controller.rb', line 9

def show
  @period_start = 1.year.ago.beginning_of_day
  @period_end = Time.current
  # The aggregation is a public facade method so a host that keeps this page off
  # (it's opt-in) can still call `Moderate.transparency(from:, to:)` to publish
  # its own report. The view renders the same hash either way.
  @summary = Moderate.transparency(from: @period_start, to: @period_end)
end