1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

use sql wrap in query helper

This commit is contained in:
Matt Jankowski 2024-06-11 11:18:54 -04:00
parent f019cbdadb
commit 4273e780c7

View file

@ -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