discourse/app/serializers/reviewable_post_serializer.rb
Roman Rizzi 6b613e3076
FEATURE: Review every post using the review queue. (#12734)
* FEATURE: Review every post using the review queue.

If the `review_every_post` setting is enabled, posts created and edited by regular uses are sent to the review queue so staff can review them. We'll skip PMs and posts created or edited by TL4 or staff users.

Staff can choose  to:

- Approve the post (nothing happens)
- Approve and restore the post (if deleted)
- Approve and unhide the post (if hidden)
- Reject and delete it
- Reject and keep deleted (if deleted)
- Reject and suspend the user
- Reject and silence the user

* Update config/locales/server.en.yml

Co-authored-by: Robin Ward <robin.ward@gmail.com>

Co-authored-by: Robin Ward <robin.ward@gmail.com>
2021-04-21 08:41:36 -03:00

23 lines
421 B
Ruby

# frozen_string_literal: true
class ReviewablePostSerializer < ReviewableSerializer
target_attributes :cooked, :raw, :reply_count, :reply_to_post_number
attributes :blank_post, :post_updated_at, :post_version
def post_version
object.target&.version
end
def post_updated_at
object.target&.updated_at
end
def blank_post
true
end
def include_blank_post?
object.target.blank?
end
end