about summary refs log tree commit diff
path: root/app/serializers/rest
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-12-17 20:36:30 +0100
committerThibG <thib@sitedethib.com>2018-12-20 14:51:12 +0100
commita1c56fcef124b08fc2676d38fd79ed72d660d865 (patch)
tree4f409ee76e3a68ad7ff028974389523f8d8ce952 /app/serializers/rest
parent0cd367e2954fd5407461a3c01e9fbfb297575145 (diff)
Add admin setting to disable followers count
Diffstat (limited to 'app/serializers/rest')
-rw-r--r--app/serializers/rest/account_serializer.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/serializers/rest/account_serializer.rb b/app/serializers/rest/account_serializer.rb
index 12adc971c..a3f2ad036 100644
--- a/app/serializers/rest/account_serializer.rb
+++ b/app/serializers/rest/account_serializer.rb
@@ -51,4 +51,8 @@ class REST::AccountSerializer < ActiveModel::Serializer
   def moved_and_not_nested?
     object.moved? && object.moved_to_account.moved_to_account_id.nil?
   end
+
+  def followers_count
+    Setting.hide_followers_count ? -1 : object.followers_count
+  end
 end