Changed strings to yes/no

This commit is contained in:
David Taylor 2017-02-28 15:22:07 +00:00
parent 0da5124f77
commit 889aeb5b6e
1 changed files with 2 additions and 2 deletions

View File

@ -341,14 +341,14 @@ SQL
require_dependency 'topic_query' require_dependency 'topic_query'
TopicQuery.add_custom_filter(:solved) do |results, topic_query| TopicQuery.add_custom_filter(:solved) do |results, topic_query|
if topic_query.options[:solved] == 'solved' if topic_query.options[:solved] == 'yes'
results = results.where("topics.id IN ( results = results.where("topics.id IN (
SELECT tc.topic_id SELECT tc.topic_id
FROM topic_custom_fields tc FROM topic_custom_fields tc
WHERE tc.name = 'accepted_answer_post_id' AND WHERE tc.name = 'accepted_answer_post_id' AND
tc.value IS NOT NULL tc.value IS NOT NULL
)") )")
elsif topic_query.options[:solved] == 'unsolved' elsif topic_query.options[:solved] == 'no'
results = results.where("topics.id NOT IN ( results = results.where("topics.id NOT IN (
SELECT tc.topic_id SELECT tc.topic_id
FROM topic_custom_fields tc FROM topic_custom_fields tc