mirror of
https://github.com/discourse/discourse.git
synced 2026-03-03 23:54:20 +08:00
As a follow-up of #35908. Allow filtering posts by user from the user card of deactivated user. ### Context The filter button was missing for deactivated accounts because `topic_post_count` wasn’t exposed in `InactiveUserSerializer`. ### Result <img width="701" height="216" alt="Screenshot 2025-11-14 at 00 11 27" src="https://github.com/user-attachments/assets/e1b8d2a4-9465-4225-aaed-0582f43b8d90" />
15 lines
274 B
Ruby
15 lines
274 B
Ruby
# frozen_string_literal: true
|
|
|
|
class InactiveUserSerializer < BasicUserSerializer
|
|
attr_accessor :topic_post_count
|
|
|
|
attributes :inactive, :topic_post_count
|
|
|
|
def inactive
|
|
!object.active?
|
|
end
|
|
|
|
def include_topic_post_count?
|
|
topic_post_count.present?
|
|
end
|
|
end
|