mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 11:43:40 +08:00
3c8ae643b2
- Display an icon on already blocked users - Automatically unblock users that you approve
37 lines
762 B
Ruby
37 lines
762 B
Ruby
class QueuedPostSerializer < ApplicationSerializer
|
|
|
|
attributes :id,
|
|
:queue,
|
|
:user_id,
|
|
:state,
|
|
:topic_id,
|
|
:approved_by_id,
|
|
:rejected_by_id,
|
|
:raw,
|
|
:post_options,
|
|
:created_at,
|
|
:category_id,
|
|
:can_delete_user
|
|
|
|
has_one :user, serializer: AdminUserListSerializer
|
|
has_one :topic, serializer: BasicTopicSerializer
|
|
|
|
def category_id
|
|
cat_id = object.topic.try(:category_id) || object.post_options['category']
|
|
cat_id.to_i if cat_id
|
|
end
|
|
|
|
def include_category_id?
|
|
category_id.present?
|
|
end
|
|
|
|
def can_delete_user
|
|
true
|
|
end
|
|
|
|
def include_can_delete_user?
|
|
user.trust_level == TrustLevel[0]
|
|
end
|
|
|
|
end
|