discourse/app/serializers/web_hook_topic_view_serializer.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
788 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class WebHookTopicViewSerializer < TopicViewSerializer
2018-05-21 10:28:12 +08:00
attributes :created_by, :last_poster
%i[
post_stream
timeline_lookup
pm_with_non_human_user
draft
draft_key
draft_sequence
message_bus_last_id
suggested_topics
2018-05-21 10:28:12 +08:00
has_summary
actions_summary
current_post_number
chunk_size
topic_timer
details
image_url
slow_mode_seconds
slow_mode_enabled_until
bookmarks
].each { |attr| define_method("include_#{attr}?") { false } }
2018-05-21 10:28:12 +08:00
def include_show_read_indicator?
false
end
2018-05-21 10:28:12 +08: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
end