Merge pull request #1109 from ZogStriP/fix-search-results-for-posts

fix deep link to post in search
This commit is contained in:
Sam
2013-06-29 04:11:38 -07:00
2 changed files with 16 additions and 1 deletions

View File

@@ -41,7 +41,9 @@ class Search
end
def self.from_post(p)
SearchResult.from_topic(p.topic)
# we want the topic link when it's the OP
return SearchResult.from_topic(p.topic) if p.post_number == 1
SearchResult.new(type: :topic, id: p.topic.id, title: p.topic.title, url: p.url)
end
end