2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-01-04 01:03:01 +08:00
|
|
|
class ReviewableQueuedPostSerializer < ReviewableSerializer
|
|
|
|
|
2019-06-06 00:12:13 +08:00
|
|
|
attributes :reply_to_post_number
|
|
|
|
|
2019-01-04 01:03:01 +08:00
|
|
|
payload_attributes(
|
|
|
|
:raw,
|
|
|
|
:title,
|
|
|
|
:archetype,
|
|
|
|
:category,
|
|
|
|
:visible,
|
|
|
|
:is_warning,
|
|
|
|
:first_post_checks,
|
|
|
|
:featured_link,
|
|
|
|
:is_poll,
|
|
|
|
:typing_duration_msecs,
|
|
|
|
:composer_open_duration_msecs,
|
2019-07-19 23:56:14 +08:00
|
|
|
:tags,
|
|
|
|
:via_email,
|
|
|
|
:raw_email
|
2019-01-04 01:03:01 +08:00
|
|
|
)
|
|
|
|
|
2019-06-06 00:12:13 +08:00
|
|
|
def reply_to_post_number
|
|
|
|
object.payload['reply_to_post_number'].to_i
|
|
|
|
end
|
|
|
|
|
|
|
|
def include_reply_to_post_number?
|
2019-06-06 00:44:56 +08:00
|
|
|
object.payload.present? && object.payload['reply_to_post_number'].present?
|
2019-06-06 00:12:13 +08:00
|
|
|
end
|
|
|
|
|
2019-01-04 01:03:01 +08:00
|
|
|
end
|