mirror of
https://github.com/discourse/discourse.git
synced 2024-12-17 04:13:40 +08:00
7f2f3b8b22
This commit makes most of the reports now lazy loaded, and making them benefits from graceful failures.
20 lines
374 B
Ruby
20 lines
374 B
Ruby
class AdminDashboardNextGeneralData < AdminDashboardNextData
|
|
def reports
|
|
@reports ||= %w{
|
|
users_by_type
|
|
users_by_trust_level
|
|
}
|
|
end
|
|
|
|
def get_json
|
|
{
|
|
reports: self.class.reports(reports).compact,
|
|
updated_at: Time.zone.now.as_json
|
|
}
|
|
end
|
|
|
|
def self.stats_cache_key
|
|
"general-dashboard-data-#{Report::SCHEMA_VERSION}"
|
|
end
|
|
end
|