mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
Embroil it in controversery
This commit is contained in:
parent
f87bbe6184
commit
84411d4c97
3 changed files with 8 additions and 10 deletions
|
@ -32,11 +32,7 @@ class Admin::Metrics::Measure::InstanceStatusesMeasure < Admin::Metrics::Measure
|
|||
.select(:id)
|
||||
.joins(:account)
|
||||
.where(account_domain_sql, domain: params[:domain])
|
||||
.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(status_range_sql, earliest_status_id: earliest_status_id, latest_status_id: latest_status_id)
|
||||
.where(daily_period(:statuses))
|
||||
end
|
||||
|
||||
|
|
|
@ -43,6 +43,12 @@ module Admin::Metrics::Measure::QueryHelper
|
|||
SQL
|
||||
end
|
||||
|
||||
def status_range_sql
|
||||
<<~SQL.squish
|
||||
statuses.id BETWEEN :earliest_status_id AND :latest_status_id
|
||||
SQL
|
||||
end
|
||||
|
||||
def account_domain_sql
|
||||
if params[:include_subdomains]
|
||||
<<~SQL.squish
|
||||
|
|
|
@ -28,11 +28,7 @@ class Admin::Metrics::Measure::TagServersMeasure < Admin::Metrics::Measure::Base
|
|||
.reorder(nil)
|
||||
.joins(:tags, :account)
|
||||
.where(statuses_tags: { tag_id: tag.id })
|
||||
.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(status_range_sql, earliest_status_id: earliest_status_id, latest_status_id: latest_status_id)
|
||||
.where(daily_period(:statuses))
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue