This repository has been archived on 2023-03-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
osr-discourse-src/app/models/admin_dashboard_general_data.rb
T

17 lines
516 B
Ruby

# frozen_string_literal: true
class AdminDashboardGeneralData < AdminDashboardData
def get_json
days_since_update = ((DateTime.now - Discourse.last_commit_date) / 1.day).to_i
{
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}"
}
end
def self.stats_cache_key
"general-dashboard-data-#{Report::SCHEMA_VERSION}"
end
end