2019-05-02 17:17:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-12-22 10:08:35 -06:00
|
|
|
class WebHookTopicViewSerializer < TopicViewSerializer
|
2018-05-20 21:28:12 -05:00
|
|
|
attributes :created_by, :last_poster
|
2016-12-22 10:08:35 -06:00
|
|
|
|
2018-02-26 21:28:31 -06:00
|
|
|
%i[
|
|
|
|
post_stream
|
|
|
|
timeline_lookup
|
|
|
|
pm_with_non_human_user
|
|
|
|
draft
|
|
|
|
draft_key
|
|
|
|
draft_sequence
|
|
|
|
message_bus_last_id
|
2018-04-10 06:08:48 -05:00
|
|
|
suggested_topics
|
2018-05-20 21:28:12 -05:00
|
|
|
has_summary
|
|
|
|
actions_summary
|
|
|
|
current_post_number
|
|
|
|
chunk_size
|
|
|
|
topic_timer
|
|
|
|
details
|
2019-10-22 09:52:37 -05:00
|
|
|
image_url
|
2020-10-16 14:24:38 -05:00
|
|
|
slow_mode_seconds
|
2021-05-21 09:13:14 -05:00
|
|
|
slow_mode_enabled_until
|
2021-09-20 17:45:47 -05:00
|
|
|
bookmarks
|
2023-07-12 09:21:51 -05:00
|
|
|
summarizable
|
2018-02-26 21:28:31 -06:00
|
|
|
].each { |attr| define_method("include_#{attr}?") { false } }
|
2018-05-20 21:28:12 -05:00
|
|
|
|
2019-08-27 07:09:00 -05:00
|
|
|
def include_show_read_indicator?
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
2018-05-20 21:28:12 -05:00
|
|
|
def created_by
|
|
|
|
BasicUserSerializer.new(object.topic.user, scope: scope, root: false)
|
|
|
|
end
|
|
|
|
|
|
|
|
def last_poster
|
|
|
|
BasicUserSerializer.new(object.topic.last_poster, scope: scope, root: false)
|
|
|
|
end
|
2016-12-22 10:08:35 -06:00
|
|
|
end
|