From dd37edf49d67b41e3eb24d8b91a6820635b41d84 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Mon, 27 Feb 2017 21:26:09 +0000 Subject: [PATCH] Only include can_have_answer if empty_box_on_unsolved is true. Thanks @SamSaffron --- plugin.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugin.rb b/plugin.rb index 5c1bcda..3f47cda 100644 --- a/plugin.rb +++ b/plugin.rb @@ -351,6 +351,10 @@ SQL return scope.allow_accepted_answers_on_category?(object.category_id) end + + def include_can_have_answer? + SiteSetting.empty_box_on_unsolved + end end TopicList.preloaded_custom_fields << "accepted_answer_post_id" if TopicList.respond_to? :preloaded_custom_fields