parent
7681ba0c32
commit
5df9370ebe
|
@ -41,10 +41,13 @@ class Search
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.from_post(p)
|
def self.from_post(p)
|
||||||
|
if p.post_number == 1
|
||||||
# we want the topic link when it's the OP
|
# we want the topic link when it's the OP
|
||||||
return SearchResult.from_topic(p.topic) if p.post_number == 1
|
SearchResult.from_topic(p.topic)
|
||||||
|
else
|
||||||
SearchResult.new(type: :topic, id: p.topic.id, title: p.topic.title, url: p.url)
|
SearchResult.new(type: :topic, id: p.topic.id, title: p.topic.title, url: p.url)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue