<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>config/countries.yml</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -43,8 +43,8 @@ class Admin::ProductsController &lt; ApplicationController
     respond_to do |format|
       if @product.save
         flash[:notice] = 'Product was successfully created.'
-        format.html { redirect_to product_url(@product) }
-        format.xml  { head :created, :location =&gt; product_url(@product) }
+        format.html { redirect_to admin_product_url(@product) }
+        format.xml  { head :created, :location =&gt; admin_product_url(@product) }
       else
         format.html { render :action =&gt; &quot;new&quot; }
         format.xml  { render :xml =&gt; @product.errors.to_xml }
@@ -60,7 +60,7 @@ class Admin::ProductsController &lt; ApplicationController
     respond_to do |format|
       if @product.update_attributes(params[:product])
         flash[:notice] = 'Product was successfully updated.'
-        format.html { redirect_to product_url(@product) }
+        format.html { redirect_to admin_product_url(@product) }
         format.xml  { head :ok }
       else
         format.html { render :action =&gt; &quot;edit&quot; }
@@ -76,7 +76,7 @@ class Admin::ProductsController &lt; ApplicationController
     @product.destroy
 
     respond_to do |format|
-      format.html { redirect_to products_url }
+      format.html { redirect_to admin_products_url }
       format.xml  { head :ok }
     end
   end</diff>
      <filename>app/controllers/admin/products_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,15 @@
 # Methods added to this helper will be available to all templates in the application.
+def load_country_names()
+  app_root = File.dirname(__FILE__) + '/../..'
+  config_dir = app_root + '/config/'
+  ymlpath = File.expand_path(config_dir + 'countries.yml')
+  $COUNTRY_NAMES = YAML.load(File.open(ymlpath))
+end
+
+load_country_names()
+
 module ApplicationHelper
+  def country_name(country_code)
+    return $COUNTRY_NAMES[country_code]
+  end
 end</diff>
      <filename>app/helpers/application_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,54 +1,3 @@
-COUNTRY_MAPPING = {
-  &quot;US&quot; =&gt; &quot;United States&quot;, &quot;AL&quot; =&gt; &quot;Albania&quot;, &quot;DZ&quot; =&gt; &quot;Algeria&quot;, &quot;AD&quot; =&gt; &quot;Andorra&quot;, &quot;AO&quot; =&gt; &quot;Angola&quot;,
-  &quot;AI&quot; =&gt; &quot;Anguilla&quot;, &quot;AG&quot; =&gt; &quot;Antigua and Barbuda&quot;, &quot;AR&quot; =&gt; &quot;Argentina&quot;, &quot;AM&quot; =&gt; &quot;Armenia&quot;,
-  &quot;AW&quot; =&gt; &quot;Aruba&quot;, &quot;AU&quot; =&gt; &quot;Australia&quot;, &quot;AT&quot; =&gt; &quot;Austria&quot;, &quot;AZ&quot; =&gt; &quot;Azerbaijan Republic&quot;,
-  &quot;BS&quot; =&gt; &quot;Bahamas&quot;, &quot;BH&quot; =&gt; &quot;Bahrain&quot;, &quot;BB&quot; =&gt; &quot;Barbados&quot;, &quot;BE&quot; =&gt; &quot;Belgium&quot;, &quot;BZ&quot; =&gt; &quot;Belize&quot;,
-  &quot;BJ&quot; =&gt; &quot;Benin&quot;, &quot;BM&quot; =&gt; &quot;Bermuda&quot;, &quot;BT&quot; =&gt; &quot;Bhutan&quot;, &quot;BO&quot; =&gt; &quot;Bolivia&quot;,
-  &quot;BA&quot; =&gt; &quot;Bosnia and Herzegovina&quot;, &quot;BW&quot; =&gt; &quot;Botswana&quot;, &quot;BR&quot; =&gt; &quot;Brazil&quot;,
-  &quot;VG&quot; =&gt; &quot;British Virgin Islands&quot;, &quot;BN&quot; =&gt; &quot;Brunei&quot;, &quot;BG&quot; =&gt; &quot;Bulgaria&quot;, &quot;BF&quot; =&gt; &quot;Burkina Faso&quot;,
-  &quot;BI&quot; =&gt; &quot;Burundi&quot;, &quot;KH&quot; =&gt; &quot;Cambodia&quot;, &quot;CA&quot; =&gt; &quot;Canada&quot;, &quot;CV&quot; =&gt; &quot;Cape Verde&quot;,
-  &quot;KY&quot; =&gt; &quot;Cayman Islands&quot;, &quot;TD&quot; =&gt; &quot;Chad&quot;, &quot;CL&quot; =&gt; &quot;Chile&quot;, &quot;C2&quot; =&gt; &quot;China&quot;, &quot;CO&quot; =&gt; &quot;Colombia&quot;,
-  &quot;KM&quot; =&gt; &quot;Comoros&quot;, &quot;CK&quot; =&gt; &quot;Cook Islands&quot;, &quot;CR&quot; =&gt; &quot;Costa Rica&quot;, &quot;HR&quot; =&gt; &quot;Croatia&quot;,
-  &quot;CY&quot; =&gt; &quot;Cyprus&quot;, &quot;CZ&quot; =&gt; &quot;Czech Republic&quot;, &quot;CD&quot; =&gt; &quot;Democratic Republic of the Congo&quot;,
-  &quot;DK&quot; =&gt; &quot;Denmark&quot;, &quot;DJ&quot; =&gt; &quot;Djibouti&quot;, &quot;DM&quot; =&gt; &quot;Dominica&quot;, &quot;DO&quot; =&gt; &quot;Dominican Republic&quot;,
-  &quot;EC&quot; =&gt; &quot;Ecuador&quot;, &quot;SV&quot; =&gt; &quot;El Salvador&quot;, &quot;ER&quot; =&gt; &quot;Eritrea&quot;, &quot;EE&quot; =&gt; &quot;Estonia&quot;, &quot;ET&quot; =&gt; &quot;Ethiopia&quot;,
-  &quot;FK&quot; =&gt; &quot;Falkland Islands&quot;, &quot;FO&quot; =&gt; &quot;Faroe Islands&quot;, &quot;FM&quot; =&gt; &quot;Federated States of Micronesia&quot;,
-  &quot;FJ&quot; =&gt; &quot;Fiji&quot;, &quot;FI&quot; =&gt; &quot;Finland&quot;, &quot;FR&quot; =&gt; &quot;France&quot;, &quot;GF&quot; =&gt; &quot;French Guiana&quot;,
-  &quot;PF&quot; =&gt; &quot;French Polynesia&quot;, &quot;GA&quot; =&gt; &quot;Gabon Republic&quot;, &quot;GM&quot; =&gt; &quot;Gambia&quot;, &quot;DE&quot; =&gt; &quot;Germany&quot;,
-  &quot;GI&quot; =&gt; &quot;Gibraltar&quot;, &quot;GR&quot; =&gt; &quot;Greece&quot;, &quot;GL&quot; =&gt; &quot;Greenland&quot;, &quot;GD&quot; =&gt; &quot;Grenada&quot;,
-  &quot;GP&quot; =&gt; &quot;Guadeloupe&quot;, &quot;GT&quot; =&gt; &quot;Guatemala&quot;, &quot;GN&quot; =&gt; &quot;Guinea&quot;, &quot;GW&quot; =&gt; &quot;Guinea Bissau&quot;,
-  &quot;GY&quot; =&gt; &quot;Guyana&quot;, &quot;HN&quot; =&gt; &quot;Honduras&quot;, &quot;HK&quot; =&gt; &quot;Hong Kong&quot;, &quot;HU&quot; =&gt; &quot;Hungary&quot;, &quot;IS&quot; =&gt; &quot;Iceland&quot;,
-  &quot;IN&quot; =&gt; &quot;India&quot;, &quot;ID&quot; =&gt; &quot;Indonesia&quot;, &quot;IE&quot; =&gt; &quot;Ireland&quot;, &quot;IL&quot; =&gt; &quot;Israel&quot;, &quot;IT&quot; =&gt; &quot;Italy&quot;,
-  &quot;JM&quot; =&gt; &quot;Jamaica&quot;, &quot;JP&quot; =&gt; &quot;Japan&quot;, &quot;JO&quot; =&gt; &quot;Jordan&quot;, &quot;KZ&quot; =&gt; &quot;Kazakhstan&quot;, &quot;KE&quot; =&gt; &quot;Kenya&quot;,
-  &quot;KI&quot; =&gt; &quot;Kiribati&quot;, &quot;KW&quot; =&gt; &quot;Kuwait&quot;, &quot;KG&quot; =&gt; &quot;Kyrgyzstan&quot;, &quot;LA&quot; =&gt; &quot;Laos&quot;, &quot;LV&quot; =&gt; &quot;Latvia&quot;,
-  &quot;LS&quot; =&gt; &quot;Lesotho&quot;, &quot;LI&quot; =&gt; &quot;Liechtenstein&quot;, &quot;LT&quot; =&gt; &quot;Lithuania&quot;, &quot;LU&quot; =&gt; &quot;Luxembourg&quot;,
-  &quot;MG&quot; =&gt; &quot;Madagascar&quot;, &quot;MW&quot; =&gt; &quot;Malawi&quot;, &quot;MY&quot; =&gt; &quot;Malaysia&quot;, &quot;MV&quot; =&gt; &quot;Maldives&quot;, &quot;ML&quot; =&gt; &quot;Mali&quot;,
-  &quot;MT&quot; =&gt; &quot;Malta&quot;, &quot;MH&quot; =&gt; &quot;Marshall Islands&quot;, &quot;MQ&quot; =&gt; &quot;Martinique&quot;, &quot;MR&quot; =&gt; &quot;Mauritania&quot;,
-  &quot;MU&quot; =&gt; &quot;Mauritius&quot;, &quot;YT&quot; =&gt; &quot;Mayotte&quot;, &quot;MX&quot; =&gt; &quot;Mexico&quot;, &quot;MN&quot; =&gt; &quot;Mongolia&quot;, &quot;MS&quot; =&gt; &quot;Montserrat&quot;,
-  &quot;MA&quot; =&gt; &quot;Morocco&quot;, &quot;MZ&quot; =&gt; &quot;Mozambique&quot;, &quot;NA&quot; =&gt; &quot;Namibia&quot;, &quot;NR&quot; =&gt; &quot;Nauru&quot;, &quot;NP&quot; =&gt; &quot;Nepal&quot;,
-  &quot;NL&quot; =&gt; &quot;Netherlands&quot;, &quot;AN&quot; =&gt; &quot;Netherlands Antilles&quot;, &quot;NC&quot; =&gt; &quot;New Caledonia&quot;,
-  &quot;NZ&quot; =&gt; &quot;New Zealand&quot;, &quot;NI&quot; =&gt; &quot;Nicaragua&quot;, &quot;NE&quot; =&gt; &quot;Niger&quot;, &quot;NU&quot; =&gt; &quot;Niue&quot;,
-  &quot;NF&quot; =&gt; &quot;Norfolk Island&quot;, &quot;NO&quot; =&gt; &quot;Norway&quot;, &quot;OM&quot; =&gt; &quot;Oman&quot;, &quot;PW&quot; =&gt; &quot;Palau&quot;, &quot;PA&quot; =&gt; &quot;Panama&quot;,
-  &quot;PG&quot; =&gt; &quot;Papua New Guinea&quot;, &quot;PE&quot; =&gt; &quot;Peru&quot;, &quot;PH&quot; =&gt; &quot;Philippines&quot;, &quot;PN&quot; =&gt; &quot;Pitcairn Islands&quot;,
-  &quot;PL&quot; =&gt; &quot;Poland&quot;, &quot;PT&quot; =&gt; &quot;Portugal&quot;, &quot;QA&quot; =&gt; &quot;Qatar&quot;, &quot;CG&quot; =&gt; &quot;Republic of the Congo&quot;,
-  &quot;RE&quot; =&gt; &quot;Reunion&quot;, &quot;RO&quot; =&gt; &quot;Romania&quot;, &quot;RU&quot; =&gt; &quot;Russia&quot;, &quot;RW&quot; =&gt; &quot;Rwanda&quot;,
-  &quot;VC&quot; =&gt; &quot;Saint Vincent and the Grenadines&quot;, &quot;WS&quot; =&gt; &quot;Samoa&quot;, &quot;SM&quot; =&gt; &quot;San Marino&quot;,
-  &quot;ST&quot; =&gt; &quot;S&#227;o Tom&#233; and Pr&#237;ncipe&quot;, &quot;SA&quot; =&gt; &quot;Saudi Arabia&quot;, &quot;SN&quot; =&gt; &quot;Senegal&quot;, &quot;SC&quot; =&gt; &quot;Seychelles&quot;,
-  &quot;SL&quot; =&gt; &quot;Sierra Leone&quot;, &quot;SG&quot; =&gt; &quot;Singapore&quot;, &quot;SK&quot; =&gt; &quot;Slovakia&quot;, &quot;SI&quot; =&gt; &quot;Slovenia&quot;,
-  &quot;SB&quot; =&gt; &quot;Solomon Islands&quot;, &quot;SO&quot; =&gt; &quot;Somalia&quot;, &quot;ZA&quot; =&gt; &quot;South Africa&quot;, &quot;KR&quot; =&gt; &quot;South Korea&quot;,
-  &quot;ES&quot; =&gt; &quot;Spain&quot;, &quot;LK&quot; =&gt; &quot;Sri Lanka&quot;, &quot;SH&quot; =&gt; &quot;St. Helena&quot;, &quot;KN&quot; =&gt; &quot;St. Kitts and Nevis&quot;,
-  &quot;LC&quot; =&gt; &quot;St. Lucia&quot;, &quot;PM&quot; =&gt; &quot;St. Pierre and Miquelon&quot;, &quot;SR&quot; =&gt; &quot;Suriname&quot;,
-  &quot;SJ&quot; =&gt; &quot;Svalbard and Jan Mayen Islands&quot;, &quot;SZ&quot; =&gt; &quot;Swaziland&quot;, &quot;SE&quot; =&gt; &quot;Sweden&quot;,
-  &quot;CH&quot; =&gt; &quot;Switzerland&quot;, &quot;TW&quot; =&gt; &quot;Taiwan&quot;, &quot;TJ&quot; =&gt; &quot;Tajikistan&quot;, &quot;TZ&quot; =&gt; &quot;Tanzania&quot;,
-  &quot;TH&quot; =&gt; &quot;Thailand&quot;, &quot;TG&quot; =&gt; &quot;Togo&quot;, &quot;TO&quot; =&gt; &quot;Tonga&quot;, &quot;TT&quot; =&gt; &quot;Trinidad and Tobago&quot;,
-  &quot;TN&quot; =&gt; &quot;Tunisia&quot;, &quot;TR&quot; =&gt; &quot;Turkey&quot;, &quot;TM&quot; =&gt; &quot;Turkmenistan&quot;, &quot;TC&quot; =&gt; &quot;Turks and Caicos Islands&quot;,
-  &quot;TV&quot; =&gt; &quot;Tuvalu&quot;, &quot;UG&quot; =&gt; &quot;Uganda&quot;, &quot;UA&quot; =&gt; &quot;Ukraine&quot;, &quot;AE&quot; =&gt; &quot;United Arab Emirates&quot;,
-  &quot;GB&quot; =&gt; &quot;United Kingdom&quot;, &quot;UY&quot; =&gt; &quot;Uruguay&quot;, &quot;VU&quot; =&gt; &quot;Vanuatu&quot;, &quot;VA&quot; =&gt; &quot;Vatican City State&quot;,
-  &quot;VE&quot; =&gt; &quot;Venezuela&quot;, &quot;VN&quot; =&gt; &quot;Vietnam&quot;, &quot;WF&quot; =&gt; &quot;Wallis and Futuna Islands&quot;, &quot;YE&quot; =&gt; &quot;Yemen&quot;,
-  &quot;ZM&quot; =&gt; &quot;Zambia&quot;
-}
-
-
 class Order &lt; ActiveRecord::Base
   has_many :line_items
   belongs_to :coupon
@@ -163,10 +112,6 @@ class Order &lt; ActiveRecord::Base
     end
   end
 
-  def country_name
-    return COUNTRY_MAPPING[self.country]
-  end
-
   def first_name=(value)
     write_attribute(:first_name, value.strip())
   end</diff>
      <filename>app/models/order.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,7 +14,7 @@ N/A
 &lt;% else -%&gt;
 &lt;%= @order.address1 -%&gt;&lt;%= ', ' + @order.address2 if @order.address2 &amp;&amp; ! @order.address2.blank? %&gt;
 &lt;%= @order.city %&gt;, &lt;%= @order.state %&gt; &lt;%= @order.zipcode %&gt;
-&lt;%= @order.country_name %&gt;
+&lt;%= country_name(@order.country) %&gt;
 &lt;% end -%&gt;
 
 Payment:</diff>
      <filename>app/views/order_mailer/lost_license_sent.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -49,7 +49,7 @@ N/A
 &lt;% else -%&gt;
 &lt;%= @order.address1 -%&gt;&lt;%= ', ' + @order.address2 if @order.address2 &amp;&amp; ! @order.address2.blank? %&gt;
 &lt;%= @order.city %&gt;, &lt;%= @order.state %&gt; &lt;%= @order.zipcode %&gt;
-&lt;%= @order.country_name %&gt;
+&lt;%= country_name(@order.country) %&gt;
 &lt;% end -%&gt;
 
 Payment:</diff>
      <filename>app/views/order_mailer/thankyou_plain.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -84,7 +84,7 @@ body { margin: 0 50pt; }
                 &lt;%=h @order.address1
 					 -%&gt;&lt;%=h ', ' + @order.address2 if @order.address2 &amp;&amp; ! @order.address2.blank? -%&gt;&lt;br/&gt;
                 &lt;%=h @order.city %&gt;, &lt;%=h @order.state %&gt; &lt;%=h @order.zipcode %&gt;&lt;br/&gt;
-                &lt;%=h @order.country_name %&gt;
+                &lt;%=h country_name(@order.country) %&gt;
 				&lt;% end -%&gt;
             &lt;/td&gt;
 			&lt;td id=&quot;payment&quot; style=&quot;width:35%;padding:5px 0;border-bottom: 3px double #ddd&quot;&gt;</diff>
      <filename>app/views/store/order/_receipt.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -53,7 +53,7 @@ class AdminProductsControllerTest &lt; Test::Unit::TestCase
     post :create, {:product =&gt; {:code =&gt; &quot;product_new_1&quot;, :name =&gt; &quot;New Product v1&quot;}}, {:logged_in =&gt; true}
 
     assert_response :redirect
-    assert_redirected_to :controller =&gt; 'admin/products' , :action =&gt; 'show'
+    assert_redirected_to admin_product_url(Product.find(:all).last)
 
     assert_equal num_products + 1, Product.count
   end</diff>
      <filename>test/functional/admin_products_controller_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>27e0d233e544c645940ce8116355741db4a908d8</id>
    </parent>
  </parents>
  <author>
    <name>Andy Kim</name>
    <email>andy@potionfactory.com</email>
  </author>
  <url>http://github.com/potionfactory/potionstore/commit/feb9aa0bbde6640762725380dc1b185da5f5baea</url>
  <id>feb9aa0bbde6640762725380dc1b185da5f5baea</id>
  <committed-date>2008-12-17T17:34:55-08:00</committed-date>
  <authored-date>2008-12-17T16:26:13-08:00</authored-date>
  <message>Refactored out country mapping into a YML file and fixed some url helper calls</message>
  <tree>838ffe2b4dd388515630408e362def0cd42f3281</tree>
  <committer>
    <name>Andy Kim</name>
    <email>andy@potionfactory.com</email>
  </committer>
</commit>
