discourse/app/serializers/web_hook_topic_view_serializer.rb
Guo Xiang Tan 0b6a2e9d1f Remove force summary mode for megatopics for now.
The logic is too hairy and we can't reliably determine
when to force summary mode. Work is underway to improve
perf for megatopics so this will not be required
eventually.
2018-06-26 12:49:06 +08:00

37 lines
721 B
Ruby

require_dependency 'pinned_check'
class WebHookTopicViewSerializer < TopicViewSerializer
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
has_summary
actions_summary
current_post_number
chunk_size
topic_timer
private_topic_timer
details
}.each do |attr|
define_method("include_#{attr}?") do
false
end
end
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