2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-10-11 01:00:08 +08:00
|
|
|
class HiddenProfileSerializer < BasicUserSerializer
|
2024-06-10 21:38:22 +08:00
|
|
|
attributes(:profile_hidden?, :title, :primary_group_name, :can_send_private_message_to_user)
|
2018-10-11 01:00:08 +08:00
|
|
|
|
|
|
|
def profile_hidden?
|
|
|
|
true
|
|
|
|
end
|
2018-11-14 22:55:38 +08:00
|
|
|
|
2024-06-10 21:38:22 +08:00
|
|
|
def can_send_private_message_to_user
|
|
|
|
scope.can_send_private_message?(object)
|
|
|
|
end
|
|
|
|
|
2018-11-14 22:55:38 +08:00
|
|
|
def primary_group_name
|
|
|
|
object.primary_group.try(:name)
|
|
|
|
end
|
2018-10-11 01:00:08 +08:00
|
|
|
end
|