2019-05-02 17:17:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-04-01 05:39:49 -05:00
|
|
|
class AdminDashboardGeneralData < AdminDashboardData
|
2018-07-19 13:33:11 -05:00
|
|
|
def get_json
|
2023-01-09 06:20:10 -06:00
|
|
|
days_since_update =
|
|
|
|
Discourse.last_commit_date ? ((DateTime.now - Discourse.last_commit_date) / 1.day).to_i : nil
|
2018-07-19 13:33:11 -05:00
|
|
|
{
|
2019-05-17 00:42:45 -05:00
|
|
|
updated_at: Time.zone.now.as_json,
|
|
|
|
discourse_updated_at: Discourse.last_commit_date,
|
2023-01-09 06:20:10 -06:00
|
|
|
release_notes_link:
|
|
|
|
"https://meta.discourse.org/c/announcements/67?tags=release-notes&before=#{days_since_update}",
|
2018-07-19 13:33:11 -05:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.stats_cache_key
|
2018-07-31 16:35:13 -05:00
|
|
|
"general-dashboard-data-#{Report::SCHEMA_VERSION}"
|
2018-07-19 13:33:11 -05:00
|
|
|
end
|
|
|
|
end
|