From d8f0b310f76a56211602ad252d4d9b7828953fe5 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Mon, 27 Feb 2017 21:19:58 +0000 Subject: [PATCH] Revert "Only send can_have_answer attribute if empty_box_on_unsolved is true" This reverts commit ea8c94681bc1d9b596cc143956fea7d85d778f0d. --- plugin.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/plugin.rb b/plugin.rb index f992a30..5c1bcda 100644 --- a/plugin.rb +++ b/plugin.rb @@ -340,20 +340,16 @@ SQL require_dependency 'topic_list_item_serializer' class ::TopicListItemSerializer - attributes :has_accepted_answer + attributes :has_accepted_answer, :can_have_answer def has_accepted_answer object.custom_fields["accepted_answer_post_id"] ? true : false end - if SiteSetting.empty_box_on_unsolved - attributes :can_have_answer + def can_have_answer + return true if SiteSetting.allow_solved_on_all_topics - def can_have_answer - return true if SiteSetting.allow_solved_on_all_topics - - return scope.allow_accepted_answers_on_category?(object.category_id) - end + return scope.allow_accepted_answers_on_category?(object.category_id) end end