DRY supported_languages

This commit is contained in:
2026-01-23 21:55:06 +01:00
parent a7713b962f
commit b3726e0777
8 changed files with 46 additions and 23 deletions
@@ -22,8 +22,7 @@ class Admin::DashboardController < Admin::BaseController
.where("invitation_sent_at > ?", 14.days.ago)
.count
@supported_languages = SupportedLanguage.where(active: true).order(:sort_order)
@language_completion = @supported_languages.index_with do |language|
@language_completion = supported_languages.index_with do |language|
next 0 if @entry_count.zero?
(Entry.where.not(language.code => [ nil, "" ]).count * 100.0 / @entry_count).round