]> cat aescling's git repositories - mastodon.git/blob - app/presenters/instance_presenter.rb
Merge branch 'master' of https://github.com/blackle/mastodon into blackle-master
[mastodon.git] / app / presenters / instance_presenter.rb
1 # frozen_string_literal: true
2
3 class InstancePresenter
4 delegate(
5 :closed_registrations_message,
6 :contact_email,
7 :open_registrations,
8 :site_description,
9 :site_extended_description,
10 to: Setting
11 )
12
13 def contact_account
14 Account.find_local(Setting.site_contact_username)
15 end
16
17 def user_count
18 Rails.cache.fetch('user_count') { User.count }
19 end
20
21 def status_count
22 Rails.cache.fetch('local_status_count') { Status.local.count }
23 end
24
25 def domain_count
26 Rails.cache.fetch('distinct_domain_count') { Account.distinct.count(:domain) }
27 end
28 end
This page took 0.077318 seconds and 5 git commands to generate.