mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
Update search_result.rb
Fix code styling
This commit is contained in:
parent
7681ba0c32
commit
5df9370ebe
1 changed files with 6 additions and 3 deletions
|
@ -41,9 +41,12 @@ class Search
|
|||
end
|
||||
|
||||
def self.from_post(p)
|
||||
# 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)
|
||||
if p.post_number == 1
|
||||
# we want the topic link when it's the OP
|
||||
SearchResult.from_topic(p.topic)
|
||||
else
|
||||
SearchResult.new(type: :topic, id: p.topic.id, title: p.topic.title, url: p.url)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue