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