lib/countries/translations.rb in countries-4.0.0 vs lib/countries/translations.rb in countries-4.0.1
- old
+ new
@@ -4,9 +4,9 @@
# ex:
# if a country has translations for pt, and the user looks up `pt-br` fallback
# to `pt` to prevent from showing nil values
class Translations < Hash
def [](locale)
- super(locale) || super(locale.sub(/-.*/, ''))
+ super(locale) || super(locale.to_s.sub(/-.*/, ''))
end
end
end