mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
Rename to data_source
This commit is contained in:
parent
20123c2c07
commit
e1b4a83f73
11 changed files with 11 additions and 11 deletions
|
@ -27,7 +27,7 @@ class Admin::Metrics::Measure::InstanceAccountsMeasure < Admin::Metrics::Measure
|
|||
nil
|
||||
end
|
||||
|
||||
def data_source_query
|
||||
def data_source
|
||||
Account
|
||||
.select(:id)
|
||||
.where(account_domain_sql, domain: params[:domain])
|
||||
|
|
|
@ -27,7 +27,7 @@ class Admin::Metrics::Measure::InstanceFollowersMeasure < Admin::Metrics::Measur
|
|||
nil
|
||||
end
|
||||
|
||||
def data_source_query
|
||||
def data_source
|
||||
Follow
|
||||
.select(:id)
|
||||
.joins(:account)
|
||||
|
|
|
@ -27,7 +27,7 @@ class Admin::Metrics::Measure::InstanceFollowsMeasure < Admin::Metrics::Measure:
|
|||
nil
|
||||
end
|
||||
|
||||
def data_source_query
|
||||
def data_source
|
||||
Follow
|
||||
.select(:id)
|
||||
.joins(:target_account)
|
||||
|
|
|
@ -36,7 +36,7 @@ class Admin::Metrics::Measure::InstanceMediaAttachmentsMeasure < Admin::Metrics:
|
|||
nil
|
||||
end
|
||||
|
||||
def data_source_query
|
||||
def data_source
|
||||
MediaAttachment
|
||||
.select(
|
||||
<<~SQL.squish
|
||||
|
|
|
@ -27,7 +27,7 @@ class Admin::Metrics::Measure::InstanceReportsMeasure < Admin::Metrics::Measure:
|
|||
nil
|
||||
end
|
||||
|
||||
def data_source_query
|
||||
def data_source
|
||||
Report
|
||||
.select(:id)
|
||||
.joins(:target_account)
|
||||
|
|
|
@ -27,7 +27,7 @@ class Admin::Metrics::Measure::InstanceStatusesMeasure < Admin::Metrics::Measure
|
|||
nil
|
||||
end
|
||||
|
||||
def data_source_query
|
||||
def data_source
|
||||
Status
|
||||
.select(:id)
|
||||
.joins(:account)
|
||||
|
|
|
@ -21,7 +21,7 @@ class Admin::Metrics::Measure::NewUsersMeasure < Admin::Metrics::Measure::BaseMe
|
|||
[sql_query_string, { start_at: @start_at, end_at: @end_at }]
|
||||
end
|
||||
|
||||
def data_source_query
|
||||
def data_source
|
||||
User
|
||||
.select(:id)
|
||||
.where(daily_period(:users))
|
||||
|
|
|
@ -21,7 +21,7 @@ class Admin::Metrics::Measure::OpenedReportsMeasure < Admin::Metrics::Measure::B
|
|||
[sql_query_string, { start_at: @start_at, end_at: @end_at }]
|
||||
end
|
||||
|
||||
def data_source_query
|
||||
def data_source
|
||||
Report
|
||||
.select(:id)
|
||||
.where(daily_period(:reports))
|
||||
|
|
|
@ -22,7 +22,7 @@ module Admin::Metrics::Measure::QueryHelper
|
|||
def sql_query_string
|
||||
<<~SQL.squish
|
||||
SELECT axis.*, (
|
||||
WITH data_source AS (#{data_source_query.to_sql})
|
||||
WITH data_source AS (#{data_source.to_sql})
|
||||
SELECT #{select_target} FROM data_source
|
||||
) AS value
|
||||
FROM (
|
||||
|
|
|
@ -17,7 +17,7 @@ class Admin::Metrics::Measure::ResolvedReportsMeasure < Admin::Metrics::Measure:
|
|||
Report.resolved.where(action_taken_at: previous_time_period).count
|
||||
end
|
||||
|
||||
def data_source_query
|
||||
def data_source
|
||||
Report
|
||||
.select(:id)
|
||||
.where(daily_period(:reports, :action_taken_at))
|
||||
|
|
|
@ -21,7 +21,7 @@ class Admin::Metrics::Measure::TagServersMeasure < Admin::Metrics::Measure::Base
|
|||
tag.statuses.where('statuses.id BETWEEN ? AND ?', Mastodon::Snowflake.id_at(@start_at - length_of_period, with_random: false), Mastodon::Snowflake.id_at(@end_at - length_of_period, with_random: false)).joins(:account).count('distinct accounts.domain')
|
||||
end
|
||||
|
||||
def data_source_query
|
||||
def data_source
|
||||
Status
|
||||
.select('accounts.domain')
|
||||
.distinct
|
||||
|
|
Loading…
Reference in a new issue