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

Commit 005e80f

Browse files
committed
FIX: Exporting overall sentiment fails
1 parent 38f7e9c commit 005e80f

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

lib/sentiment/sentiment_dashboard_report.rb

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,17 @@ def self.register!(plugin)
4242

4343
return report if grouped_sentiments.empty?
4444

45-
report.data = {
46-
req: "overall_sentiment",
47-
color: report.colors[:lime],
48-
label: I18n.t("discourse_ai.sentiment.reports.overall_sentiment"),
49-
data:
50-
grouped_sentiments.map do |gs|
51-
{ x: gs.posted_at, y: gs.public_send("sentiment_count") }
52-
end,
53-
}
45+
report.data = [
46+
{
47+
req: "overall_sentiment",
48+
color: report.colors[:lime],
49+
label: I18n.t("discourse_ai.sentiment.reports.overall_sentiment"),
50+
data:
51+
grouped_sentiments.map do |gs|
52+
{ x: gs.posted_at, y: gs.public_send("sentiment_count") }
53+
end,
54+
},
55+
]
5456
end
5557
end
5658
end

0 commit comments

Comments
 (0)