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