Inline EventSummary#tallied_boosts

This commit is contained in:
Jose Farias
2024-10-28 10:07:25 -06:00
parent 8b062b4432
commit c571c4400d
+1 -5
View File
@@ -28,14 +28,10 @@ class EventSummary < ApplicationRecord
end
def boosts_summary
if (tally = tallied_boosts.presence)
if tally = events.boosts.group(:creator).count.presence
tally.map do |creator, count|
"#{creator.name} +#{count}"
end.to_sentence + "."
end
end
def tallied_boosts
events.boosts.group(:creator).count
end
end