Handle null language in sailors log

This commit is contained in:
Max Wofford
2025-03-26 02:32:22 -04:00
parent d27d3542ed
commit 1395c12d4a

View File

@@ -53,6 +53,7 @@ class SailorsLogLeaderboard < ApplicationRecord
# Get most common language per project using ActiveRecord
most_common_languages = user_heartbeats
.where.not(language: nil)
.group(:project, :language)
.count
.group_by { |k, _| k[0] } # Group by project