diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index da3a23dfe80..c08952c59af 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -60,8 +60,6 @@ class UsersController < ApplicationController user_serializer = nil if guardian.can_see_profile?(@user) user_serializer = UserSerializer.new(@user, scope: guardian, root: 'user') - # TODO remove this options from serializer - user_serializer.omit_stats = true topic_id = params[:include_post_count_for].to_i if topic_id != 0 diff --git a/app/serializers/user_serializer.rb b/app/serializers/user_serializer.rb index cb7bc9971e4..43bbc569768 100644 --- a/app/serializers/user_serializer.rb +++ b/app/serializers/user_serializer.rb @@ -2,8 +2,7 @@ class UserSerializer < BasicUserSerializer - attr_accessor :omit_stats, - :topic_post_count + attr_accessor :topic_post_count def self.staff_attributes(*attrs) attributes(*attrs) @@ -48,7 +47,6 @@ class UserSerializer < BasicUserSerializer :can_edit_username, :can_edit_email, :can_edit_name, - :stats, :ignored, :muted, :can_ignore_user, @@ -109,7 +107,6 @@ class UserSerializer < BasicUserSerializer :tracked_category_ids, :watched_category_ids, :watched_first_post_category_ids, - :private_messages_stats, :system_avatar_upload_id, :system_avatar_template, :gravatar_avatar_upload_id, @@ -257,14 +254,6 @@ class UserSerializer < BasicUserSerializer scope.can_edit_name?(object) end - def include_stats? - !omit_stats == true - end - - def stats - UserAction.stats(object.id, scope) - end - def ignored IgnoredUser.where(user_id: scope.user&.id, ignored_user_id: object.id).exists? end @@ -378,14 +367,6 @@ class UserSerializer < BasicUserSerializer IgnoredUser.where(user_id: object.id).joins(:ignored_user).pluck(:username) end - def include_private_messages_stats? - can_edit && !(omit_stats == true) - end - - def private_messages_stats - UserAction.private_messages_stats(object.id, scope) - end - def system_avatar_upload_id # should be left blank end diff --git a/app/serializers/web_hook_user_serializer.rb b/app/serializers/web_hook_user_serializer.rb index b14f75a2647..4fd63a8abe6 100644 --- a/app/serializers/web_hook_user_serializer.rb +++ b/app/serializers/web_hook_user_serializer.rb @@ -3,10 +3,6 @@ class WebHookUserSerializer < UserSerializer attributes :external_id - def omit_stats - true - end - # remove staff attributes def staff_attributes(*attrs) end