FIX: Stop register_topic_list_preload_user_ids from breaking old versions (#160)

We need a proper fix, but this stops the bleeding for now.
Wrapped code related to `register_topic_list_preload_user_ids` in
a `respond_to?(:register_topic_list_preload_user_ids)` block because
this API is not available in beta or stable versions of Discourse.
This commit is contained in:
Martin Brennan 2021-08-31 13:30:17 +10:00 committed by GitHub
parent 6b6d5978a2
commit cf368c19cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 42 additions and 40 deletions

View File

@ -695,6 +695,7 @@ SQL
.count
end
if respond_to?(:register_topic_list_preload_user_ids)
class ::Topic
attr_accessor :accepted_answer_user_id
end
@ -744,4 +745,5 @@ SQL
prepend AddSolvedToTopicPostersSummary
end
end
end