From 453874b6306c9b1bb0060434fa998ba81d105b14 Mon Sep 17 00:00:00 2001 From: Luke Barratt Date: Sat, 15 Aug 2015 23:30:34 +0100 Subject: [PATCH] Read country code from I18n gem --- app/models/user.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 28fd617..4547d26 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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