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