From f3d9e6163936101200c4670822eccfe81be3e7c6 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 11 Jun 2024 11:38:42 -0400 Subject: [PATCH] Separate tags / betweens --- app/lib/admin/metrics/measure/tag_servers_measure.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/lib/admin/metrics/measure/tag_servers_measure.rb b/app/lib/admin/metrics/measure/tag_servers_measure.rb index a76c67c7e35..8d2fbf3739b 100644 --- a/app/lib/admin/metrics/measure/tag_servers_measure.rb +++ b/app/lib/admin/metrics/measure/tag_servers_measure.rb @@ -28,9 +28,13 @@ class Admin::Metrics::Measure::TagServersMeasure < Admin::Metrics::Measure::Base .reorder(nil) .joins(:tags, :account) .where( - <<~SQL.squish, tag_id: tag.id, earliest_status_id: earliest_status_id, latest_status_id: latest_status_id + <<~SQL.squish, tag_id: tag.id statuses_tags.tag_id = :tag_id - AND statuses.id BETWEEN :earliest_status_id AND :latest_status_id + SQL + ) + .where( + <<~SQL.squish, earliest_status_id: earliest_status_id, latest_status_id: latest_status_id + statuses.id BETWEEN :earliest_status_id AND :latest_status_id SQL ) .where(daily_period(:statuses))