DEV: ensure compatibilty with stable
This commit is contained in:
parent
142b3db6b8
commit
8de0fa9ecf
|
@ -69,6 +69,7 @@ after_initialize do
|
|||
end
|
||||
end
|
||||
|
||||
if TopicQuery.respond_to?(:results_filter_callbacks)
|
||||
TopicQuery.results_filter_callbacks << ->(_type, result, user, options) {
|
||||
result = result.includes(:topic_vote_count)
|
||||
|
||||
|
@ -89,6 +90,7 @@ after_initialize do
|
|||
|
||||
result
|
||||
}
|
||||
end
|
||||
|
||||
add_to_serializer(:category, :custom_fields) do
|
||||
object.custom_fields.merge(enable_topic_voting: DiscourseVoting::CategorySetting.find_by(category_id: object.id).present?)
|
||||
|
|
Loading…
Reference in New Issue