闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
591 B

  1. # frozen_string_literal: true
  2. class InstancePresenter
  3. delegate(
  4. :closed_registrations_message,
  5. :site_contact_email,
  6. :open_registrations,
  7. :site_description,
  8. :site_extended_description,
  9. to: Setting
  10. )
  11. def contact_account
  12. Account.find_local(Setting.site_contact_username)
  13. end
  14. def user_count
  15. Rails.cache.fetch('user_count') { User.count }
  16. end
  17. def status_count
  18. Rails.cache.fetch('local_status_count') { Status.local.count }
  19. end
  20. def domain_count
  21. Rails.cache.fetch('distinct_domain_count') { Account.distinct.count(:domain) }
  22. end
  23. end