Fix country for undefined

This commit is contained in:
Ari Timonen 2020-03-16 03:12:22 +02:00
parent 0e64bb9333
commit 9952bf52b5
2 changed files with 5 additions and 8 deletions

View file

@ -1,9 +1,3 @@
GIT
remote: git://github.com/anton-zaytsev/acts_as_rateable.git
revision: 01066eceb2d16e35be437b7392cc3375f1f377f7
specs:
acts_as_rateable (3.0.0)
GIT
remote: https://github.com/koraktor/steam-condenser-ruby.git
revision: 2cb441f0518a0b8d20a017dfcc42783ae878311a
@ -333,7 +327,6 @@ PLATFORMS
DEPENDENCIES
active_link_to (~> 1.0.2)
active_record_union
acts_as_rateable!
annotate
bbcoder (~> 1.0.1)
better_errors

View file

@ -145,7 +145,11 @@ class User < ActiveRecord::Base
def country_s
country_object = ISO3166::Country[country]
country_object.translations[I18n.locale.to_s] || country_object.name
if country_object
country_object.translations[I18n.locale.to_s] || country_object.name
else
"Unknown"
end
end
def realname