Browse files

Add upgrading instructions

  • Loading branch information...
1 parent dbae8ff commit f2217dbfb0f2de6efb3a242e48689012f7911375 @scudco committed Feb 18, 2014
Showing with 48 additions and 2 deletions.
  1. +6 −2
  2. +42 −0
@@ -8,6 +8,10 @@ While the ISO 3166 standard is a relatively neutral source of country
names, it may still offend some users. Developers are strongly advised
to evaluate the suitability of this list given their user base.
+[**An important message about upgrading from 1.0**](
## Installation
Install as a gem using
@@ -64,7 +68,7 @@ resistant to country names changing.
The locale can be overridden locally:
-country_select("user", "country_code", ['US'], {:locale => 'es'})
+country_select("user", "country_code", ['US'], locale: 'es')
@@ -84,7 +88,7 @@ class User < ActiveRecord::Base
# This will attempt to translate the country name and use the default
# (usually English) name if no translation is available
def country_name
- country = Country[country_code]
+ country = ISO3166::Country[country_code]
country.translations[I18n.locale.to_s] ||
@@ -0,0 +1,42 @@
+# Upgrading from 1.x
+`country_select` 2.0 has brought a few small changes, but these changes
+can have a big impact on existing production systems. Please read these
+points carefully and consider whether upgrading to 2.0 is a good idea.
+Please post any implications we may have missed as a GitHub Issue
+or Pull Request.
+## ISO codes are always on
+If you upgrade to 2.0 and are currently storing countries by the names
+produced by this gem, your setup will break. It is recommended that you
+stick with 1.x until developing a data migration strategy that allows
+you to map your existing country names to country codes.
+## i18n country names are always on (when available)
+Country names will be generated using `I18n.locale` if a translation
+from the countries gem is available.
+## Codes are UPCASED
+The official ISO 3166-1 standard uses UPCASED codes. This is an easy
+data change, but may affect areas of code dependent on lowercase country
+Here's a sample SQL migration that could address a `users` table with
+lowercased country codes stored in the `country_code` column:
+UPDATE users SET country_code = UPPER(country_code);
+## Ruby 1.9+
+`country_select` will no longer be tested in Ruby `< 1.9`.
+## Rails 4+
+`country_select` will no longer be tested in Rails `< 4`.

0 comments on commit f2217db

Please sign in to comment.