diff --git a/.discourse-compatibility b/.discourse-compatibility index e69de29b..93b44056 100644 --- a/.discourse-compatibility +++ b/.discourse-compatibility @@ -0,0 +1 @@ +3.1.0.beta3: 057fbe1ce6 diff --git a/lib/modules/embeddings/entry_point.rb b/lib/modules/embeddings/entry_point.rb index 7466afcc..9dfe277f 100644 --- a/lib/modules/embeddings/entry_point.rb +++ b/lib/modules/embeddings/entry_point.rb @@ -34,18 +34,17 @@ module DiscourseAi end %i[topic_view TopicViewPosts].each do |serializer| - plugin.add_to_serializer(serializer, :related_topics) do + plugin.add_to_serializer( + serializer, + :related_topics, + include_condition: -> { SiteSetting.ai_embeddings_semantic_related_topics_enabled }, + ) do if object.next_page.nil? && !object.topic.private_message? object.related_topics.map do |t| SuggestedTopicSerializer.new(t, scope: scope, root: false) end end end - - # custom include method so we also check on semantic search - plugin.add_to_serializer(serializer, :include_related_topics?) do - plugin.enabled? && SiteSetting.ai_embeddings_semantic_related_topics_enabled - end end callback =