Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 1fd3f7e

Browse files
committed
fix
1 parent e14b159 commit 1fd3f7e

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lib/sentiment/entry_point.rb

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@ def inject_into(plugin)
1414
plugin.on(:post_created, &sentiment_analysis_cb)
1515
plugin.on(:post_edited, &sentiment_analysis_cb)
1616

17-
plugin.add_to_serializer(
18-
:current_user,
19-
:can_see_sentiment_reports,
20-
include_condition: -> do
21-
SiteSetting.ai_sentiment_enabled && SiteSetting.ai_sentiment_reports_enabled
22-
end,
23-
) { ClassificationResult.has_sentiment_classification? }
17+
plugin.add_to_serializer(:current_user, :can_see_sentiment_reports) do
18+
ClassificationResult.has_sentiment_classification? && SiteSetting.ai_sentiment_enabled &&
19+
SiteSetting.ai_sentiment_reports_enabled
20+
end
2421

2522
if Rails.env.test? ||
2623
ClassificationResult.has_sentiment_classification? &&

0 commit comments

Comments
 (0)