2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-01-04 01:03:01 +08:00
|
|
|
class ReviewableFlaggedPostSerializer < ReviewableSerializer
|
2019-06-06 00:12:13 +08:00
|
|
|
target_attributes :cooked, :raw, :reply_count, :reply_to_post_number
|
2019-05-04 04:36:37 +08:00
|
|
|
attributes :blank_post, :post_updated_at, :post_version
|
|
|
|
|
2023-09-05 10:11:39 +08:00
|
|
|
def created_from_flag?
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
2019-05-04 04:36:37 +08:00
|
|
|
def post_version
|
|
|
|
object.target&.version
|
|
|
|
end
|
2019-05-03 21:42:43 +08:00
|
|
|
|
|
|
|
def post_updated_at
|
|
|
|
object.target&.updated_at
|
|
|
|
end
|
2019-04-18 04:14:36 +08:00
|
|
|
|
|
|
|
def blank_post
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
def include_blank_post?
|
|
|
|
object.target.blank?
|
|
|
|
end
|
2019-01-04 01:03:01 +08:00
|
|
|
end
|