Skip to content

Commit 2f3dbb3

Browse files
Fix reference to outdated topic custom field accepted_answer_post_id (#238)
Fix reference to outdated topic custom field accepted_answer_post_id --------- Co-authored-by: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com>
1 parent dcc48a7 commit 2f3dbb3

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

lib/docs/query.rb

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,8 @@ def list
4949
end
5050
end
5151

52-
if @filters[:solved].present?
53-
results =
54-
results.where(
55-
"topics.id IN (
56-
SELECT tc.topic_id
57-
FROM topic_custom_fields tc
58-
WHERE tc.name = 'accepted_answer_post_id' AND
59-
tc.value IS NOT NULL
60-
)",
61-
)
52+
if @filters[:solved].present? && defined?(DiscourseSolved::SolvedTopic)
53+
results = results.joins(:solved)
6254
end
6355

6456
# filter results by search term

0 commit comments

Comments
 (0)