DEV: Drop obsolete code (#170)

This commit is contained in:
Jarek Radosz 2021-10-28 15:13:24 +02:00 committed by GitHub
parent 2678dbdf0c
commit 668ea21131
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 10 deletions

View File

@ -256,16 +256,7 @@ SQL
mount ::DiscourseSolved::Engine, at: "solution"
end
# TODO Drop after Discourse 2.6.0 release
if TopicView.respond_to?(:add_post_custom_fields_allowlister)
TopicView.add_post_custom_fields_allowlister do |user|
["is_accepted_answer"]
end
else
TopicView.add_post_custom_fields_whitelister do |user|
["is_accepted_answer"]
end
end
topic_view_post_custom_fields_allowlister { ["is_accepted_answer"] }
def get_schema_text(post)
post.excerpt(nil, keep_onebox_body: true).presence || post.excerpt(nil, keep_onebox_body: true, keep_quotes: true)