FEATURE: search all solved topics with in:solved

This commit is contained in:
Sam 2015-06-23 12:31:10 +10:00
parent 667ec087a0
commit 7ebd56665b
1 changed files with 15 additions and 0 deletions

View File

@ -188,6 +188,21 @@ after_initialize do
end end
end end
require_dependency 'search'
#TODO Remove when plugin is 1.0
if Search.respond_to? :advanced_filter
Search.advanced_filter(/in:solved/) do |posts|
posts.where("topics.id IN (
SELECT tc.topic_id
FROM topic_custom_fields tc
WHERE tc.name = 'accepted_answer_post_id' AND
tc.value IS NOT NULL
)")
end
end
require_dependency 'topic_list_item_serializer' require_dependency 'topic_list_item_serializer'
class ::TopicListItemSerializer class ::TopicListItemSerializer