Read country code from I18n gem

This commit is contained in:
Luke Barratt 2015-08-15 23:30:34 +01:00
parent e6c2ebcbc3
commit 453874b630

View file

@ -140,11 +140,12 @@ class User < ActiveRecord::Base
end
def country_s
CountryCodeSelect::Countries::COUNTRIES.each do |c|
if c[1] == country
return c[0]
I18nCountrySelect::Countries::COUNTRY_CODES.each do |code|
if code == country
return I18n.t(code, :scope => :countries, :default => 'missing')
end
end
country
end