mirror of
https://github.com/discourse/discourse.git
synced 2024-12-27 06:03:46 +08:00
988a175e94
This commit is a subset of the changes proposed in https://github.com/discourse/discourse/pull/17379.
26 lines
465 B
Ruby
26 lines
465 B
Ruby
# frozen_string_literal: true
|
|
|
|
class BasicReviewableQueuedPostSerializer < BasicReviewableSerializer
|
|
attributes :topic_fancy_title, :payload_title, :is_new_topic
|
|
|
|
def topic_fancy_title
|
|
object.topic.fancy_title
|
|
end
|
|
|
|
def payload_title
|
|
object.payload["title"]
|
|
end
|
|
|
|
def is_new_topic
|
|
object.payload["title"].present?
|
|
end
|
|
|
|
def include_topic_fancy_title?
|
|
object.topic.present?
|
|
end
|
|
|
|
def include_payload_title?
|
|
is_new_topic
|
|
end
|
|
end
|