From 4273e780c74518e862d7d52d630a52541c3b56b4 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 11 Jun 2024 11:18:54 -0400 Subject: [PATCH] use sql wrap in query helper --- app/lib/admin/metrics/measure/query_helper.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/lib/admin/metrics/measure/query_helper.rb b/app/lib/admin/metrics/measure/query_helper.rb index 1165bcc0b45..879d25cea75 100644 --- a/app/lib/admin/metrics/measure/query_helper.rb +++ b/app/lib/admin/metrics/measure/query_helper.rb @@ -41,9 +41,13 @@ module Admin::Metrics::Measure::QueryHelper def account_domain_sql if params[:include_subdomains] - "accounts.domain IN (SELECT domain FROM instances WHERE reverse('.' || domain) LIKE reverse('.' || :domain::text))" + <<~SQL.squish + accounts.domain IN (SELECT domain FROM instances WHERE reverse('.' || domain) LIKE reverse('.' || :domain::text)) + SQL else - 'accounts.domain = :domain::text' + <<~SQL.squish + accounts.domain = :domain::text + SQL end end end