Commit 1d45e28b by Rocky Duan

removed actually useful code...

parent 5615c726
...@@ -66,6 +66,16 @@ class CommentThread < Content ...@@ -66,6 +66,16 @@ class CommentThread < Content
c c
end end
def self.search_result_to_hash(result, params={})
comment_thread = self.find(result.id)
highlight = result.highlight || {}
highlighted_body = (highlight[:body] || []).first || comment_thread.body
highlighted_title = (highlight[:title] || []).first || comment_thread.title
find(result.id).to_hash(params).merge(highlighted_body: highlighted_body, highlighted_title: highlighted_title)
end
def root_comments def root_comments
Comment.roots.where(comment_thread_id: self.id) Comment.roots.where(comment_thread_id: self.id)
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment