discourse/app/models/admin_dashboard_general_data.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
546 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2019-04-01 18:39:49 +08:00
class AdminDashboardGeneralData < AdminDashboardData
def get_json
days_since_update = Discourse.last_commit_date ? ((DateTime.now - Discourse.last_commit_date) / 1.day).to_i : nil
{
updated_at: Time.zone.now.as_json,
discourse_updated_at: Discourse.last_commit_date,
release_notes_link: "https://meta.discourse.org/c/announcements/67?tags=release-notes&before=#{days_since_update}"
}
end
def self.stats_cache_key
"general-dashboard-data-#{Report::SCHEMA_VERSION}"
end
end