FEATURE: in:unsolved filter

This commit is contained in:
Sam 2015-06-23 12:56:22 +10:00
parent 7ebd56665b
commit 8011731aa0
1 changed files with 10 additions and 0 deletions

View File

@ -201,6 +201,16 @@ after_initialize do
)")
end
Search.advanced_filter(/in:unsolved/) do |posts|
posts.where("topics.id NOT 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'