Class: AdminDashboardGeneralData

Inherits:
AdminDashboardData show all
Defined in:
app/models/admin_dashboard_general_data.rb

Constant Summary

Constants inherited from AdminDashboardData

AdminDashboardData::PROBLEM_MESSAGE_PREFIX, AdminDashboardData::SCHEDULED_PROBLEM_STORAGE_KEY

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AdminDashboardData

add_found_scheduled_check_problem, add_problem_check, add_problem_message, add_scheduled_problem_check, #as_json, clear_found_problem, clear_found_scheduled_check_problems, clear_problem_message, clear_problems_started, #email_polling_errored_recently, execute_scheduled_checks, #facebook_config_check, #failing_emails_check, fetch_problems, fetch_stats, #force_https_check, #github_config_check, #google_analytics_version_check, #google_oauth2_config_check, #host_names_check, #image_magick_check, #initialize, #legacy_navigation_menu_check, load_found_scheduled_check_problems, #missing_mailgun_api_key, #out_of_date_themes, problem_message_check, problem_message_key, #problems, problems_started_at, problems_started_key, #queue_size_check, #rails_env_check, #ram_check, register_default_scheduled_problem_checks, reports, reset_problem_checks, #s3_cdn_check, #s3_config_check, set_found_scheduled_check_problems, set_problems_started, #sidekiq_check, #subfolder_ends_in_slash_check, #translation_overrides_check, #twitter_config_check, #unreachable_themes, #watched_words_check

Constructor Details

This class inherits a constructor from AdminDashboardData

Class Method Details

.stats_cache_keyObject



15
16
17
# File 'app/models/admin_dashboard_general_data.rb', line 15

def self.stats_cache_key
  "general-dashboard-data-#{Report::SCHEMA_VERSION}"
end

Instance Method Details

#get_jsonObject



4
5
6
7
8
9
10
11
12
13
# File 'app/models/admin_dashboard_general_data.rb', line 4

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