Skip to content

Commit 46abf24

Browse files
committed
Fix country labels
1 parent 8eb747d commit 46abf24

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

app/models/rollups/daily_geo.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
class Rollups::DailyGeo < ActiveRecord::Base
22
establish_connection :clickhouse
3+
4+
def country
5+
ISO3166::Country[country_code] || "Other"
6+
end
7+
8+
def country_label
9+
if country_code == "Other"
10+
"Other"
11+
else
12+
country.iso_short_name
13+
end
14+
end
315
end

app/views/metrics/_countries_card.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<ul class="list-group list-group-flush position-relative">
33
<% countries.map do |country| %>
44
<li class="list-group-item d-flex justify-content-between">
5-
<span class="z-1"><%= country[:country_code] %></span>
5+
<span class="z-1"><%= country.country_label %></span>
66
<span class="z-1"><%= number_with_delimiter(country[:count]) || 0 %></span>
77
</li>
88
<% end %>

0 commit comments

Comments
 (0)