diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-02-22 18:06:29 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2022-02-22 18:06:29 +0100 |
commit | 954e052b0727099be97552af577831a8a0f81a88 (patch) | |
tree | 560526b10076fdfa31245fe8bfdd4a58303ae214 /app/lib/admin/metrics/measure/opened_reports_measure.rb | |
parent | e0d94323bc8f6c5d249452e2baf1f103c15546b8 (diff) | |
parent | 166f6e4b500dd84eeffdbf887b2dc21e6d8c0aa6 (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `app/models/media_attachment.rb`: Upstream moved hardcoded values around, while in glitch-soc they are configurable. Moved them like upstream, but keeping glitch-soc's ability to configure them through env vars.
Diffstat (limited to 'app/lib/admin/metrics/measure/opened_reports_measure.rb')
-rw-r--r-- | app/lib/admin/metrics/measure/opened_reports_measure.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/lib/admin/metrics/measure/opened_reports_measure.rb b/app/lib/admin/metrics/measure/opened_reports_measure.rb index 9acc2c33d..4b80a0c8c 100644 --- a/app/lib/admin/metrics/measure/opened_reports_measure.rb +++ b/app/lib/admin/metrics/measure/opened_reports_measure.rb @@ -5,15 +5,17 @@ class Admin::Metrics::Measure::OpenedReportsMeasure < Admin::Metrics::Measure::B 'opened_reports' end - def total + protected + + def perform_total_query Report.where(created_at: time_period).count end - def previous_total + def perform_previous_total_query Report.where(created_at: previous_time_period).count end - def data + def perform_data_query sql = <<-SQL.squish SELECT axis.*, ( WITH new_reports AS ( |