mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
wrap with sql
This commit is contained in:
parent
324e9673cb
commit
abe946296b
1 changed files with 5 additions and 1 deletions
|
@ -38,7 +38,11 @@ class Admin::Metrics::Measure::InstanceMediaAttachmentsMeasure < Admin::Metrics:
|
||||||
|
|
||||||
def data_source_query
|
def data_source_query
|
||||||
MediaAttachment
|
MediaAttachment
|
||||||
.select('COALESCE(media_attachments.file_file_size, 0) + COALESCE(media_attachments.thumbnail_file_size, 0) AS size')
|
.select(
|
||||||
|
<<~SQL.squish
|
||||||
|
COALESCE(media_attachments.file_file_size, 0) + COALESCE(media_attachments.thumbnail_file_size, 0) AS size
|
||||||
|
SQL
|
||||||
|
)
|
||||||
.joins(:account)
|
.joins(:account)
|
||||||
.where(account_domain_sql, domain: params[:domain])
|
.where(account_domain_sql, domain: params[:domain])
|
||||||
.where(daily_period(:media_attachments))
|
.where(daily_period(:media_attachments))
|
||||||
|
|
Loading…
Reference in a new issue