2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-04 08:47:37 +08:00
discourse/app/serializers/flagged_user_serializer.rb

20 lines
393 B
Ruby

class FlaggedUserSerializer < BasicUserSerializer
attributes :can_delete_all_posts,
:can_be_deleted,
:post_count,
:topic_count,
:ip_address
def can_delete_all_posts
scope.can_delete_all_posts?(object)
end
def can_be_deleted
scope.can_delete_user?(object)
end
def ip_address
object.ip_address.try(:to_s)
end
end