2019-05-02 17:17:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-09 12:41:25 -05:00
|
|
|
class SearchPostSerializer < BasicPostSerializer
|
2017-05-30 19:53:12 -05:00
|
|
|
has_one :topic, serializer: SearchTopicListItemSerializer
|
2014-09-02 04:15:08 -05:00
|
|
|
|
2020-08-06 23:43:09 -05:00
|
|
|
attributes :like_count, :blurb, :post_number, :topic_title_headline
|
|
|
|
|
|
|
|
def include_topic_title_headline?
|
|
|
|
if SiteSetting.use_pg_headlines_for_excerpt
|
|
|
|
object.topic_title_headline.present?
|
|
|
|
else
|
|
|
|
false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def topic_title_headline
|
|
|
|
object.topic_title_headline
|
|
|
|
end
|
2015-09-18 02:16:10 -05:00
|
|
|
|
2014-09-02 04:15:08 -05:00
|
|
|
def blurb
|
|
|
|
options[:result].blurb(object)
|
|
|
|
end
|
2019-03-20 01:38:14 -05:00
|
|
|
|
|
|
|
def include_cooked?
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
|
|
|
def include_ignored?
|
|
|
|
false
|
|
|
|
end
|
2014-09-02 04:15:08 -05:00
|
|
|
end
|