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:
parent
f019cbdadb
commit
4273e780c7
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue