forge-cli 0.0.18 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +106 -0
  3. data/bin/cucumber +16 -0
  4. data/bin/erubis +16 -0
  5. data/bin/htmldiff +16 -0
  6. data/bin/ldiff +16 -0
  7. data/bin/rackup +16 -0
  8. data/bin/rake +16 -0
  9. data/bin/rdoc +16 -0
  10. data/bin/ri +16 -0
  11. data/bin/sprockets +16 -0
  12. data/bin/thor +16 -0
  13. data/bin/tilt +16 -0
  14. data/bin/tt +16 -0
  15. data/lib/forge-cli.rb +1 -0
  16. data/lib/forge-cli/application_creator.rb +25 -6
  17. data/lib/forge-cli/controller_module_includer.rb +43 -0
  18. data/lib/forge-cli/module_installer.rb +18 -13
  19. data/lib/forge-cli/modules/banners/routes.rb +1 -1
  20. data/lib/forge-cli/modules/base/forge_routes.rb +4 -4
  21. data/lib/forge-cli/modules/base/manifest.yml +9 -4
  22. data/lib/forge-cli/modules/base/post_hooks.rb +9 -2
  23. data/lib/forge-cli/modules/base/routes.rb +4 -4
  24. data/lib/forge-cli/modules/dispatches/forge_routes.rb +2 -2
  25. data/lib/forge-cli/modules/dispatches/manifest.yml +2 -1
  26. data/lib/forge-cli/modules/ecommerce/manifest.yml +5 -1
  27. data/lib/forge-cli/modules/ecommerce/post_hooks.rb +13 -21
  28. data/lib/forge-cli/modules/events/routes.rb +1 -1
  29. data/lib/forge-cli/modules/posts/manifest.yml +4 -1
  30. data/lib/forge-cli/modules/posts/post_hooks.rb +9 -17
  31. data/lib/forge-cli/modules/posts/routes.rb +1 -1
  32. data/lib/forge-cli/modules/videos/routes.rb +1 -1
  33. data/lib/forge-cli/version.rb +2 -2
  34. data/lib/forge/Gemfile +3 -9
  35. data/lib/forge/Gemfile.lock +214 -210
  36. data/lib/forge/app/controllers/forge/help_topics_controller.rb +2 -2
  37. data/lib/forge/app/controllers/forge/posts_controller.rb +1 -0
  38. data/lib/forge/app/controllers/forge/products_controller.rb +0 -4
  39. data/lib/forge/app/controllers/forge/users_controller.rb +0 -1
  40. data/lib/forge/app/controllers/forge_controller.rb +7 -6
  41. data/lib/forge/app/controllers/posts_controller.rb +0 -2
  42. data/lib/forge/app/controllers/sessions_controller.rb +2 -3
  43. data/lib/forge/app/helpers/forge_helper.rb +2 -2
  44. data/lib/forge/app/models/address.rb +3 -0
  45. data/lib/forge/app/models/asset.rb +9 -10
  46. data/lib/forge/app/models/banner.rb +3 -1
  47. data/lib/forge/app/models/comment.rb +17 -2
  48. data/lib/forge/app/models/comment_subscriber.rb +3 -0
  49. data/lib/forge/app/models/contact.rb +3 -0
  50. data/lib/forge/app/models/country.rb +5 -2
  51. data/lib/forge/app/models/dispatch.rb +5 -2
  52. data/lib/forge/app/models/dispatch_bounce.rb +3 -0
  53. data/lib/forge/app/models/dispatch_link.rb +4 -1
  54. data/lib/forge/app/models/dispatch_link_click.rb +4 -0
  55. data/lib/forge/app/models/dispatch_open.rb +5 -1
  56. data/lib/forge/app/models/dispatch_unsubscribe.rb +4 -0
  57. data/lib/forge/app/models/event.rb +3 -1
  58. data/lib/forge/app/models/gallery.rb +4 -1
  59. data/lib/forge/app/models/help_topic.rb +4 -1
  60. data/lib/forge/app/models/line_item.rb +2 -2
  61. data/lib/forge/app/models/order.rb +1 -1
  62. data/lib/forge/app/models/order_transaction.rb +3 -0
  63. data/lib/forge/app/models/page.rb +5 -5
  64. data/lib/forge/app/models/photo.rb +5 -1
  65. data/lib/forge/app/models/post.rb +3 -1
  66. data/lib/forge/app/models/post_category.rb +4 -0
  67. data/lib/forge/app/models/product.rb +4 -2
  68. data/lib/forge/app/models/product_category.rb +4 -1
  69. data/lib/forge/app/models/product_image.rb +4 -0
  70. data/lib/forge/app/models/province.rb +4 -1
  71. data/lib/forge/app/models/queued_dispatch.rb +7 -4
  72. data/lib/forge/app/models/role.rb +3 -0
  73. data/lib/forge/app/models/sale.rb +2 -0
  74. data/lib/forge/app/models/subscriber.rb +4 -0
  75. data/lib/forge/app/models/subscriber_group.rb +4 -0
  76. data/lib/forge/app/models/subscriber_group_member.rb +4 -0
  77. data/lib/forge/app/models/tax_rate.rb +5 -2
  78. data/lib/forge/app/models/user.rb +1 -2
  79. data/lib/forge/app/models/video.rb +2 -0
  80. data/lib/forge/app/models/video_feed.rb +2 -2
  81. data/lib/forge/app/views/forge/assets/_asset.html.haml +1 -1
  82. data/lib/forge/app/views/forge/posts/_post.html.haml +5 -2
  83. data/lib/forge/app/views/forge/settings/_ecommerce.html.haml +4 -0
  84. data/lib/forge/app/views/forge/subscribers/_subscriber.html.haml +2 -2
  85. data/lib/forge/app/views/user_mailer/approved.html.haml +1 -1
  86. data/lib/forge/config/application.rb +3 -9
  87. data/lib/forge/config/database.yml.template +30 -0
  88. data/lib/forge/config/environments/development.rb +3 -7
  89. data/lib/forge/config/environments/production.rb +6 -0
  90. data/lib/forge/config/environments/test.rb +5 -3
  91. data/lib/forge/config/initializers/ckeditor.rb +15 -143
  92. data/lib/forge/config/initializers/devise.rb +12 -2
  93. data/lib/forge/config/initializers/ecommerce.rb +1 -1
  94. data/lib/forge/config/initializers/secret_token.rb +1 -10
  95. data/lib/forge/config/routes.rb +7 -11
  96. data/lib/forge/config/settings.yml +82 -5
  97. data/lib/forge/config/sitemap.yml +3 -1
  98. data/lib/forge/db/migrate/20130405172031_create_products_tax_rates.rb +15 -0
  99. data/lib/forge/db/migrate/{20130405172040_create_subscribers copy.rb → 20130405172040_create_subscribers.rb} +0 -0
  100. data/lib/forge/db/seeds.rb +304 -298
  101. data/lib/forge/doc/update_to_rails4_notes.md +15 -0
  102. data/lib/forge/lib/assets/javascripts/forge/features/help.js.erb +5 -4
  103. data/lib/forge/lib/assets/javascripts/forge/forge_manifest.js.erb +2 -2
  104. data/lib/forge/lib/assets/stylesheets/forge/forge.ui.css.scss +4 -3
  105. data/lib/forge/lib/forge/can_use_asset.rb +5 -7
  106. data/lib/forge/lib/forge/config/ecommerce.rb +3 -3
  107. data/lib/forge/lib/forge/shared_controller_methods/ecommerce.rb +3 -3
  108. data/lib/forge/lib/generators/forge/scaffold/USAGE +1 -1
  109. data/lib/forge/lib/tasks/forge.rake +5 -10
  110. data/lib/forge/public/500.html +1 -0
  111. data/lib/forge/public/javascripts/ckeditor/config.js +0 -1
  112. metadata +39 -39
  113. data/README.rdoc +0 -4
  114. data/lib/forge/app/models/comment_observer.rb +0 -9
  115. data/lib/forge/app/sweepers/page_sweeper.rb +0 -11
@@ -2,9 +2,12 @@
2
2
  # four configuration values can also be set straight in your models.
3
3
  Devise.setup do |config|
4
4
  config.case_insensitive_keys = [:email]
5
+ config.strip_whitespace_keys = [ :email ]
5
6
  config.reset_password_within = 6.hours
6
7
  config.router_name = :main_app
7
8
 
9
+ config.secret_key = 'DEVISE_SECRET_KEY'
10
+
8
11
  # ==> Mailer Configuration
9
12
  # Configure the e-mail address which will be shown in DeviseMailer.
10
13
  config.mailer_sender = "please-change-me@config-initializers-devise.com"
@@ -41,7 +44,11 @@ Devise.setup do |config|
41
44
  # ==> Configuration for :database_authenticatable
42
45
  # For bcrypt, this is the cost for hashing the password and defaults to 10. If
43
46
  # using other encryptors, it sets how many times you want the password re-encrypted.
44
- config.stretches = 10
47
+ #
48
+ # Limiting the stretches to just one in testing will increase the performance of
49
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
50
+ # a value less than 10 in other environments.
51
+ config.stretches = Rails.env.test? ? 1 : 10
45
52
 
46
53
  # Define which will be the encryption algorithm. Devise also supports encryptors
47
54
  # from others authentication tools as :clearance_sha1, :authlogic_sha512 (then
@@ -50,7 +57,7 @@ Devise.setup do |config|
50
57
  # config.encryptor = :bcrypt
51
58
 
52
59
  # Setup a pepper to generate the encrypted password.
53
- config.pepper = "108d63f00a98346f84f236b6f960736495d7e22e8f5dbc2e6ff661bf32eb587386da507c890ae42866f8af588a5f73ae2750cc95f754a2da24721effe1ba9c90"
60
+ config.pepper = "DEVISE_PEPPER"
54
61
 
55
62
  # ==> Configuration for :confirmable
56
63
  # The time you want to give your user to confirm his account. During this time
@@ -120,7 +127,10 @@ Devise.setup do |config|
120
127
  # Configure sign_out behavior.
121
128
  # By default sign_out is scoped (i.e. /users/sign_out affects only :user scope).
122
129
  # In case of sign_out_all_scopes set to true any logout action will sign out all active scopes.
130
+ #
123
131
  # config.sign_out_all_scopes = false
132
+ # The default HTTP method used to sign out a resource. Default is :delete.
133
+ config.sign_out_via = :delete
124
134
 
125
135
  # ==> Navigation configuration
126
136
  # Lists the formats that should be treated as navigational. Formats like
@@ -2,4 +2,4 @@
2
2
  ActiveMerchant::Shipping::Package.default_options = { :units => :metric }
3
3
  if Forge.config.ecommerce.active_merchant
4
4
  ActiveMerchant::Billing::Base.mode = Forge.config.ecommerce.active_merchant[:base_mode].to_sym
5
- end
5
+ end
@@ -1,10 +1 @@
1
- Forge3::Application.config.secret_token = begin
2
- Rails.root.join("config/secret_token.txt").read
3
- rescue Errno::ENOENT
4
- $stderr.puts "Couldn't find a static secret token. Generating a temporary one..."
5
- $stderr.puts "Next time, run: rake forge:secret"
6
-
7
- require 'digest/md5'
8
-
9
- Digest::MD5.hexdigest(`uname -a`)
10
- end
1
+ Forge3::Application.config.secret_token = "SECRET_TOKEN"
@@ -177,22 +177,18 @@ Forge3::Application.routes.draw do
177
177
  resource :settings, :only => [:show, :update]
178
178
 
179
179
  #resources :help_topics, :only => [:index, :show]
180
- match "help", :controller => :help_topics, :action => :index
181
- match "help/search", :controller => :help_topics, :action => :search
182
- match "help/:slug", :controller => :help_topics, :action => :show
180
+ match "help", :controller => :help_topics, :action => :index, :via => :get
181
+ match "help/search", :controller => :help_topics, :action => :search, :via => :get
182
+ match "help/:slug", :controller => :help_topics, :action => :show, :via => :get
183
183
 
184
184
  root :to => "index#index"
185
185
  end
186
186
 
187
187
  #See how all your routes lay out with "rake routes"
188
188
 
189
- #This is a legacy wild controller route that's not recommended for RESTful applications.
190
- #Note: This route will make all actions in every controller accessible via GET requests.
191
- #match ':controller(/:action(/:id(.:format)))'
192
-
193
- match 'posts/:month/:year', :controller => 'posts', :action => 'index'
194
- match '/pages/preview', :controller => 'pages', :action => 'preview'
195
- match "/sitemap", :controller => 'index', :action => 'sitemap'
196
- match '*slugs', :controller => 'pages', :action => 'show'
189
+ match 'posts/:month/:year', :controller => 'posts', :action => 'index', :via => :get
190
+ match '/pages/preview', :controller => 'pages', :action => 'preview', :via => :get
191
+ match "/sitemap", :controller => 'index', :action => 'sitemap', :via => :get
192
+ match '*slugs', :controller => 'pages', :action => 'show', :via => :get
197
193
  root :to => "index#index"
198
194
  end
@@ -1,8 +1,85 @@
1
- development:
2
- fake_setting: ''
1
+ #
2
+ # mention S3
3
+ #
4
+ # Languages
5
+ # languages:
6
+ # french: fr
7
+ # german: de
3
8
 
4
- production:
5
- fake_setting: ''
9
+ # global settings, not related to any particular environment
10
+ events:
11
+ display: calendar
12
+
13
+ # The currency that funds are accepted in. Caution: MUST be an ISO 4217 currency code. Common codes: USD, CAD, EUR.
14
+ currency: CAD
15
+
16
+ # integrated payments means using on-site CC payments with ActiveMerchant. non-integrated defaults to PayPal at this point.
17
+ integrated_payments: true
18
+
19
+ # Accept coupons in the e-commerce section?
20
+ use_coupons: false
21
+
22
+ # Charge a flat rate per product for shipping? The alternative is the more complex postal service integration.
23
+ flat_rate_shipping: false
24
+
25
+ # Send our own email receipt in addition to whatever receipt may be generated by the payment gateway?
26
+ email_receipt: true
27
+
28
+ # Optional text for accessing support that is used in app/views/forge/help_topics/show.html.haml
29
+ # This text is displayed immediately after the sentence 'If none of the above was helpful to you, you can browse the help index'
30
+ # So, if you provide additional support via email, etc., you can add it by saying something like:
31
+ # or <a href="mailto:support@example.com">send us an email</a>
32
+ # (The 'or' is necessary for the complete sentence to make sense.) HTML is allowed. If you do not provide additional support, leave
33
+ # this blank.
34
+ support_instructions_in_help: or <a href='mailto:support@factore.ca'>send us an email and we'll help you out</a>
35
+
36
+ # Optional text for accessing support that is displayed in the main application layout. Located at the end of
37
+ # app/views/layouts/forge.html.haml. HTML is allowed. If you do not provide additional support, leave this blank.
38
+ support_instructions_in_layout: <a href="mailto:support@factore.ca">Support Requests</a>&nbsp;|&nbsp;<a href="http://factore.ca/contact" target="_">Other Inquiries</a>
39
+
40
+
41
+
42
+ # Optional text that is displayed below the 'SEO Tips' section of the 'SEO Fields' tab that is present on the forms for resources like
43
+ # pages and posts. We use this text to advertise our SEO and online marketing services. This text is used in app/views/forge/shared/_seo_fields.html.haml
44
+ # HTML is allowed.
45
+ seo_callout: <p>factor[e] offers a range of advanced search engine optimization and online marketing services. Contact us on <a href="http://factore.ca/contact">our website</a> or at 905-522-7894 to get started.</p>
46
+
47
+
48
+ # zencoder video encoding settings
49
+ zencoder:
50
+ api_key: 9cee5d23f4f560d75ad2e4b4e9e88148
51
+ bucket: forge3_encoded
52
+
53
+ # environment-specific settings
54
+ development:
55
+ canada_post:
56
+ login: CPC_DEMO_XML
57
+ paypal:
58
+ account: marc_1274469546_biz@factore.ca
59
+ active_merchant:
60
+ base_mode: test
61
+ gateway: BogusGateway
62
+ login:
63
+ password:
6
64
 
7
65
  test:
8
- fake_setting: ''
66
+ canada_post:
67
+ login: CPC_DEMO_XML
68
+ paypal:
69
+ account: forge_test@factore.ca
70
+ active_merchant:
71
+ base_mode: test
72
+ gateway: BogusGateway
73
+ login:
74
+ password:
75
+
76
+ production:
77
+ canada_post:
78
+ login: XXX_XXXX_XXX
79
+ paypal:
80
+ account:
81
+ active_merchant:
82
+ base_mode: production
83
+ gateway: MonerisGateway
84
+ login:
85
+ password:
@@ -1,7 +1,9 @@
1
+ # Use this in conjunction with db/seeds.rb to load a basic site structure. You can create a list of pages
2
+ # and a set of post categories like this if you wish. Following are examples of each:
1
3
  Pages:
2
4
  Home: ''
3
5
  Contact Us: ''
4
6
 
5
7
  PostCategory:
6
8
  - General
7
- - Unfiled
9
+ - Unfiled
@@ -0,0 +1,15 @@
1
+ class CreateProductsTaxRates < ActiveRecord::Migration
2
+ def up
3
+ create_table "products_tax_rates", :id => false, :force => true do |t|
4
+ t.integer "product_id"
5
+ t.integer "tax_rate_id"
6
+ end
7
+
8
+ add_index "products_tax_rates", ["product_id"], :name => "index_products_tax_rates_on_product_id"
9
+ add_index "products_tax_rates", ["tax_rate_id"], :name => "index_products_tax_rates_on_tax_rate_id"
10
+ end
11
+
12
+ def down
13
+ drop_table "products_tax_rates"
14
+ end
15
+ end
@@ -5,11 +5,13 @@
5
5
  #
6
6
  # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
7
7
  # Mayor.create(:name => 'Daley', :city => cities.first)
8
- ["Super Admin", "Admin", "Contributor", "Member"].each {|r| Role.find_or_create_by_title(r)}
8
+ ["Super Admin", "Admin", "Contributor", "Member"].each {|r| Role.find_or_create_by(title: r)}
9
9
 
10
10
  %w{admin super_admin contributor member}.each do |role|
11
11
  password = ENV['PASSWORD'].blank? ? role : ENV['PASSWORD']
12
- user = User.new(:password => password, :password_confirmation => password, :email => "#{role}@factore.ca")
12
+ user = User.new
13
+ user.password = user.password_confirmation = password
14
+ user.email = "#{role}@example.com"
13
15
  user.approved = true
14
16
  user.roles << Role.find_by_title(role.humanize.titleize)
15
17
  if user.save
@@ -28,7 +30,7 @@ puts "\n============\nBUILDING PAGES"
28
30
  content = "<p>Edit this page in Forge</p>"
29
31
  classes["Pages"].each do |page, subpages|
30
32
  p = Page.new(:title => page, :slug => page.parameterize, :key => page.parameterize, :content => content, :published => true)
31
- puts p.save ? "Created #{page}" : "Errors on #{page}: " + p.errors.map { |e| "#{e[0]} #{e[1]}"}.join(', ')
33
+ puts p.save ? "Created #{page}" : "Errors on #{page}: " + p.errors.full_messages.to_sentence
32
34
  # Build the Subpages
33
35
  if p.errors.blank?
34
36
  subpages.each do |subpage, subsubpages|
@@ -43,302 +45,306 @@ end
43
45
  puts "\n============\nPOST CATEGORIES"
44
46
  classes["PostCategory"].each do |category|
45
47
  pc = PostCategory.new(:title => category)
46
- puts pc.save ? "Created #{category}" : "Errors on #{category}: " + pc.errors.map { |e| "#{e[0]} #{e[1]}"}.join(', ')
48
+ puts pc.save ? "Created #{category}" : "Errors on #{category}: " + pc.errors.full_messages.to_sentence
47
49
  end
48
50
 
49
- # Build default countries
50
- Country.create(:code => 'AF', :title => 'Afghanistan')
51
- Country.create(:code => 'AL', :title => 'Albania')
52
- Country.create(:code => 'DZ', :title => 'Algeria')
53
- Country.create(:code => 'AS', :title => 'American Samoa')
54
- Country.create(:code => 'AD', :title => 'Andorra')
55
- Country.create(:code => 'AO', :title => 'Angola')
56
- Country.create(:code => 'AI', :title => 'Anguilla')
57
- Country.create(:code => 'AG', :title => 'Antigua and Barbuda')
58
- Country.create(:code => 'AR', :title => 'Argentina')
59
- Country.create(:code => 'AM', :title => 'Armenia')
60
- Country.create(:code => 'AW', :title => 'Aruba')
61
- Country.create(:code => 'AU', :title => 'Australia')
62
- Country.create(:code => 'AT', :title => 'Austria')
63
- Country.create(:code => 'AZ', :title => 'Azerbaijan')
64
- Country.create(:code => 'BS', :title => 'Bahamas')
65
- Country.create(:code => 'BH', :title => 'Bahrain')
66
- Country.create(:code => 'BD', :title => 'Bangladesh')
67
- Country.create(:code => 'BB', :title => 'Barbados')
68
- Country.create(:code => 'BY', :title => 'Belarus')
69
- Country.create(:code => 'BE', :title => 'Belgium')
70
- Country.create(:code => 'BZ', :title => 'Belize')
71
- Country.create(:code => 'BJ', :title => 'Benin')
72
- Country.create(:code => 'BM', :title => 'Bermuda')
73
- Country.create(:code => 'BT', :title => 'Bhutan')
74
- Country.create(:code => 'BO', :title => 'Bolivia')
75
- Country.create(:code => 'BA', :title => 'Bosnia and Herzegovina')
76
- Country.create(:code => 'BW', :title => 'Botswana')
77
- Country.create(:code => 'BR', :title => 'Brazil')
78
- Country.create(:code => 'BN', :title => 'Brunei Darussalam')
79
- Country.create(:code => 'BG', :title => 'Bulgaria')
80
- Country.create(:code => 'BF', :title => 'Burkina Faso')
81
- Country.create(:code => 'BI', :title => 'Burundi')
82
- Country.create(:code => 'KH', :title => 'Cambodia')
83
- Country.create(:code => 'CM', :title => 'Cameroon')
84
- Country.create(:code => 'CA', :title => 'Canada', :active => true, :top_of_list => true)
85
- Country.create(:code => 'CV', :title => 'Cape Verde')
86
- Country.create(:code => 'KY', :title => 'Cayman Islands')
87
- Country.create(:code => 'CF', :title => 'Central African Republic')
88
- Country.create(:code => 'TD', :title => 'Chad')
89
- Country.create(:code => 'CL', :title => 'Chile')
90
- Country.create(:code => 'CN', :title => 'China')
91
- Country.create(:code => 'CO', :title => 'Colombia')
92
- Country.create(:code => 'KM', :title => 'Comoros')
93
- Country.create(:code => 'CG', :title => 'Congo')
94
- Country.create(:code => 'CD', :title => 'Congo, the Democratic Republic of the')
95
- Country.create(:code => 'CK', :title => 'Cook Islands')
96
- Country.create(:code => 'CR', :title => 'Costa Rica')
97
- Country.create(:code => 'CI', :title => 'Cote D\'Ivoire')
98
- Country.create(:code => 'HR', :title => 'Croatia')
99
- Country.create(:code => 'CU', :title => 'Cuba')
100
- Country.create(:code => 'CY', :title => 'Cyprus')
101
- Country.create(:code => 'CZ', :title => 'Czech Republic')
102
- Country.create(:code => 'DK', :title => 'Denmark')
103
- Country.create(:code => 'DJ', :title => 'Djibouti')
104
- Country.create(:code => 'DM', :title => 'Dominica')
105
- Country.create(:code => 'DO', :title => 'Dominican Republic')
106
- Country.create(:code => 'EC', :title => 'Ecuador')
107
- Country.create(:code => 'EG', :title => 'Egypt')
108
- Country.create(:code => 'SV', :title => 'El Salvador')
109
- Country.create(:code => 'GQ', :title => 'Equatorial Guinea')
110
- Country.create(:code => 'ER', :title => 'Eritrea')
111
- Country.create(:code => 'EE', :title => 'Estonia')
112
- Country.create(:code => 'ET', :title => 'Ethiopia')
113
- Country.create(:code => 'FK', :title => 'Falkland Islands (Malvinas)')
114
- Country.create(:code => 'FO', :title => 'Faroe Islands')
115
- Country.create(:code => 'FJ', :title => 'Fiji')
116
- Country.create(:code => 'FI', :title => 'Finland')
117
- Country.create(:code => 'FR', :title => 'France')
118
- Country.create(:code => 'GF', :title => 'French Guiana')
119
- Country.create(:code => 'PF', :title => 'French Polynesia')
120
- Country.create(:code => 'GA', :title => 'Gabon')
121
- Country.create(:code => 'GM', :title => 'Gambia')
122
- Country.create(:code => 'GE', :title => 'Georgia')
123
- Country.create(:code => 'DE', :title => 'Germany')
124
- Country.create(:code => 'GH', :title => 'Ghana')
125
- Country.create(:code => 'GI', :title => 'Gibraltar')
126
- Country.create(:code => 'GR', :title => 'Greece')
127
- Country.create(:code => 'GL', :title => 'Greenland')
128
- Country.create(:code => 'GD', :title => 'Grenada')
129
- Country.create(:code => 'GP', :title => 'Guadeloupe')
130
- Country.create(:code => 'GU', :title => 'Guam')
131
- Country.create(:code => 'GT', :title => 'Guatemala')
132
- Country.create(:code => 'GN', :title => 'Guinea')
133
- Country.create(:code => 'GW', :title => 'Guinea-Bissau')
134
- Country.create(:code => 'GY', :title => 'Guyana')
135
- Country.create(:code => 'HT', :title => 'Haiti')
136
- Country.create(:code => 'VA', :title => 'Holy See (Vatican City State)')
137
- Country.create(:code => 'HN', :title => 'Honduras')
138
- Country.create(:code => 'HK', :title => 'Hong Kong')
139
- Country.create(:code => 'HU', :title => 'Hungary')
140
- Country.create(:code => 'IS', :title => 'Iceland')
141
- Country.create(:code => 'IN', :title => 'India')
142
- Country.create(:code => 'ID', :title => 'Indonesia')
143
- Country.create(:code => 'IR', :title => 'Iran, Islamic Republic of')
144
- Country.create(:code => 'IQ', :title => 'Iraq')
145
- Country.create(:code => 'IE', :title => 'Ireland')
146
- Country.create(:code => 'IL', :title => 'Israel')
147
- Country.create(:code => 'IT', :title => 'Italy')
148
- Country.create(:code => 'JM', :title => 'Jamaica')
149
- Country.create(:code => 'JP', :title => 'Japan')
150
- Country.create(:code => 'JO', :title => 'Jordan')
151
- Country.create(:code => 'KZ', :title => 'Kazakhstan')
152
- Country.create(:code => 'KE', :title => 'Kenya')
153
- Country.create(:code => 'KI', :title => 'Kiribati')
154
- Country.create(:code => 'KP', :title => 'Korea, Democratic People\'s Republic of')
155
- Country.create(:code => 'KR', :title => 'Korea, Republic of')
156
- Country.create(:code => 'KW', :title => 'Kuwait')
157
- Country.create(:code => 'KG', :title => 'Kyrgyzstan')
158
- Country.create(:code => 'LA', :title => 'Lao People\'s Democratic Republic')
159
- Country.create(:code => 'LV', :title => 'Latvia')
160
- Country.create(:code => 'LB', :title => 'Lebanon')
161
- Country.create(:code => 'LS', :title => 'Lesotho')
162
- Country.create(:code => 'LR', :title => 'Liberia')
163
- Country.create(:code => 'LY', :title => 'Libyan Arab Jamahiriya')
164
- Country.create(:code => 'LI', :title => 'Liechtenstein')
165
- Country.create(:code => 'LT', :title => 'Lithuania')
166
- Country.create(:code => 'LU', :title => 'Luxembourg')
167
- Country.create(:code => 'MO', :title => 'Macao')
168
- Country.create(:code => 'MK', :title => 'Macedonia, the Former Yugoslav Republic of')
169
- Country.create(:code => 'MG', :title => 'Madagascar')
170
- Country.create(:code => 'MW', :title => 'Malawi')
171
- Country.create(:code => 'MY', :title => 'Malaysia')
172
- Country.create(:code => 'MV', :title => 'Maldives')
173
- Country.create(:code => 'ML', :title => 'Mali')
174
- Country.create(:code => 'MT', :title => 'Malta')
175
- Country.create(:code => 'MH', :title => 'Marshall Islands')
176
- Country.create(:code => 'MQ', :title => 'Martinique')
177
- Country.create(:code => 'MR', :title => 'Mauritania')
178
- Country.create(:code => 'MU', :title => 'Mauritius')
179
- Country.create(:code => 'MX', :title => 'Mexico')
180
- Country.create(:code => 'FM', :title => 'Micronesia, Federated States of')
181
- Country.create(:code => 'MD', :title => 'Moldova, Republic of')
182
- Country.create(:code => 'MC', :title => 'Monaco')
183
- Country.create(:code => 'MN', :title => 'Mongolia')
184
- Country.create(:code => 'MS', :title => 'Montserrat')
185
- Country.create(:code => 'MA', :title => 'Morocco')
186
- Country.create(:code => 'MZ', :title => 'Mozambique')
187
- Country.create(:code => 'MM', :title => 'Myanmar')
188
- Country.create(:code => 'NA', :title => 'Namibia')
189
- Country.create(:code => 'NR', :title => 'Nauru')
190
- Country.create(:code => 'NP', :title => 'Nepal')
191
- Country.create(:code => 'NL', :title => 'Netherlands')
192
- Country.create(:code => 'AN', :title => 'Netherlands Antilles')
193
- Country.create(:code => 'NC', :title => 'New Caledonia')
194
- Country.create(:code => 'NZ', :title => 'New Zealand')
195
- Country.create(:code => 'NI', :title => 'Nicaragua')
196
- Country.create(:code => 'NE', :title => 'Niger')
197
- Country.create(:code => 'NG', :title => 'Nigeria')
198
- Country.create(:code => 'NU', :title => 'Niue')
199
- Country.create(:code => 'NF', :title => 'Norfolk Island')
200
- Country.create(:code => 'MP', :title => 'Northern Mariana Islands')
201
- Country.create(:code => 'NO', :title => 'Norway')
202
- Country.create(:code => 'OM', :title => 'Oman')
203
- Country.create(:code => 'PK', :title => 'Pakistan')
204
- Country.create(:code => 'PW', :title => 'Palau')
205
- Country.create(:code => 'PA', :title => 'Panama')
206
- Country.create(:code => 'PG', :title => 'Papua New Guinea')
207
- Country.create(:code => 'PY', :title => 'Paraguay')
208
- Country.create(:code => 'PE', :title => 'Peru')
209
- Country.create(:code => 'PH', :title => 'Philippines')
210
- Country.create(:code => 'PN', :title => 'Pitcairn')
211
- Country.create(:code => 'PL', :title => 'Poland')
212
- Country.create(:code => 'PT', :title => 'Portugal')
213
- Country.create(:code => 'PR', :title => 'Puerto Rico')
214
- Country.create(:code => 'QA', :title => 'Qatar')
215
- Country.create(:code => 'RE', :title => 'Reunion')
216
- Country.create(:code => 'RO', :title => 'Romania')
217
- Country.create(:code => 'RU', :title => 'Russian Federation')
218
- Country.create(:code => 'RW', :title => 'Rwanda')
219
- Country.create(:code => 'SH', :title => 'Saint Helena')
220
- Country.create(:code => 'KN', :title => 'Saint Kitts and Nevis')
221
- Country.create(:code => 'LC', :title => 'Saint Lucia')
222
- Country.create(:code => 'PM', :title => 'Saint Pierre and Miquelon')
223
- Country.create(:code => 'VC', :title => 'Saint Vincent and the Grenadines')
224
- Country.create(:code => 'WS', :title => 'Samoa')
225
- Country.create(:code => 'SM', :title => 'San Marino')
226
- Country.create(:code => 'ST', :title => 'Sao Tome and Principe')
227
- Country.create(:code => 'SA', :title => 'Saudi Arabia')
228
- Country.create(:code => 'SN', :title => 'Senegal')
229
- Country.create(:code => 'SC', :title => 'Seychelles')
230
- Country.create(:code => 'SL', :title => 'Sierra Leone')
231
- Country.create(:code => 'SG', :title => 'Singapore')
232
- Country.create(:code => 'SK', :title => 'Slovakia')
233
- Country.create(:code => 'SI', :title => 'Slovenia')
234
- Country.create(:code => 'SB', :title => 'Solomon Islands')
235
- Country.create(:code => 'SO', :title => 'Somalia')
236
- Country.create(:code => 'ZA', :title => 'South Africa')
237
- Country.create(:code => 'ES', :title => 'Spain')
238
- Country.create(:code => 'LK', :title => 'Sri Lanka')
239
- Country.create(:code => 'SD', :title => 'Sudan')
240
- Country.create(:code => 'SR', :title => 'Suriname')
241
- Country.create(:code => 'SJ', :title => 'Svalbard and Jan Mayen')
242
- Country.create(:code => 'SZ', :title => 'Swaziland')
243
- Country.create(:code => 'SE', :title => 'Sweden')
244
- Country.create(:code => 'CH', :title => 'Switzerland')
245
- Country.create(:code => 'SY', :title => 'Syrian Arab Republic')
246
- Country.create(:code => 'TW', :title => 'Taiwan, Province of China')
247
- Country.create(:code => 'TJ', :title => 'Tajikistan')
248
- Country.create(:code => 'TZ', :title => 'Tanzania, United Republic of')
249
- Country.create(:code => 'TH', :title => 'Thailand')
250
- Country.create(:code => 'TG', :title => 'Togo')
251
- Country.create(:code => 'TK', :title => 'Tokelau')
252
- Country.create(:code => 'TO', :title => 'Tonga')
253
- Country.create(:code => 'TT', :title => 'Trinidad and Tobago')
254
- Country.create(:code => 'TN', :title => 'Tunisia')
255
- Country.create(:code => 'TR', :title => 'Turkey')
256
- Country.create(:code => 'TM', :title => 'Turkmenistan')
257
- Country.create(:code => 'TC', :title => 'Turks and Caicos Islands')
258
- Country.create(:code => 'TV', :title => 'Tuvalu')
259
- Country.create(:code => 'UG', :title => 'Uganda')
260
- Country.create(:code => 'UA', :title => 'Ukraine')
261
- Country.create(:code => 'AE', :title => 'United Arab Emirates')
262
- Country.create(:code => 'GB', :title => 'United Kingdom')
263
- Country.create(:code => 'US', :title => 'United States', :active => true, :top_of_list => true)
264
- Country.create(:code => 'UY', :title => 'Uruguay')
265
- Country.create(:code => 'UZ', :title => 'Uzbekistan')
266
- Country.create(:code => 'VU', :title => 'Vanuatu')
267
- Country.create(:code => 'VE', :title => 'Venezuela')
268
- Country.create(:code => 'VN', :title => 'Viet Nam')
269
- Country.create(:code => 'VG', :title => 'Virgin Islands, British')
270
- Country.create(:code => 'VI', :title => 'Virgin Islands, U.s.')
271
- Country.create(:code => 'WF', :title => 'Wallis and Futuna')
272
- Country.create(:code => 'EH', :title => 'Western Sahara')
273
- Country.create(:code => 'YE', :title => 'Yemen')
274
- Country.create(:code => 'ZM', :title => 'Zambia')
275
- Country.create(:code => 'ZW', :title => 'Zimbabwe')
51
+ begin
52
+ # Build default countries
53
+ Country.create(:code => 'AF', :title => 'Afghanistan')
54
+ Country.create(:code => 'AL', :title => 'Albania')
55
+ Country.create(:code => 'DZ', :title => 'Algeria')
56
+ Country.create(:code => 'AS', :title => 'American Samoa')
57
+ Country.create(:code => 'AD', :title => 'Andorra')
58
+ Country.create(:code => 'AO', :title => 'Angola')
59
+ Country.create(:code => 'AI', :title => 'Anguilla')
60
+ Country.create(:code => 'AG', :title => 'Antigua and Barbuda')
61
+ Country.create(:code => 'AR', :title => 'Argentina')
62
+ Country.create(:code => 'AM', :title => 'Armenia')
63
+ Country.create(:code => 'AW', :title => 'Aruba')
64
+ Country.create(:code => 'AU', :title => 'Australia')
65
+ Country.create(:code => 'AT', :title => 'Austria')
66
+ Country.create(:code => 'AZ', :title => 'Azerbaijan')
67
+ Country.create(:code => 'BS', :title => 'Bahamas')
68
+ Country.create(:code => 'BH', :title => 'Bahrain')
69
+ Country.create(:code => 'BD', :title => 'Bangladesh')
70
+ Country.create(:code => 'BB', :title => 'Barbados')
71
+ Country.create(:code => 'BY', :title => 'Belarus')
72
+ Country.create(:code => 'BE', :title => 'Belgium')
73
+ Country.create(:code => 'BZ', :title => 'Belize')
74
+ Country.create(:code => 'BJ', :title => 'Benin')
75
+ Country.create(:code => 'BM', :title => 'Bermuda')
76
+ Country.create(:code => 'BT', :title => 'Bhutan')
77
+ Country.create(:code => 'BO', :title => 'Bolivia')
78
+ Country.create(:code => 'BA', :title => 'Bosnia and Herzegovina')
79
+ Country.create(:code => 'BW', :title => 'Botswana')
80
+ Country.create(:code => 'BR', :title => 'Brazil')
81
+ Country.create(:code => 'BN', :title => 'Brunei Darussalam')
82
+ Country.create(:code => 'BG', :title => 'Bulgaria')
83
+ Country.create(:code => 'BF', :title => 'Burkina Faso')
84
+ Country.create(:code => 'BI', :title => 'Burundi')
85
+ Country.create(:code => 'KH', :title => 'Cambodia')
86
+ Country.create(:code => 'CM', :title => 'Cameroon')
87
+ Country.create(:code => 'CA', :title => 'Canada', :active => true, :top_of_list => true)
88
+ Country.create(:code => 'CV', :title => 'Cape Verde')
89
+ Country.create(:code => 'KY', :title => 'Cayman Islands')
90
+ Country.create(:code => 'CF', :title => 'Central African Republic')
91
+ Country.create(:code => 'TD', :title => 'Chad')
92
+ Country.create(:code => 'CL', :title => 'Chile')
93
+ Country.create(:code => 'CN', :title => 'China')
94
+ Country.create(:code => 'CO', :title => 'Colombia')
95
+ Country.create(:code => 'KM', :title => 'Comoros')
96
+ Country.create(:code => 'CG', :title => 'Congo')
97
+ Country.create(:code => 'CD', :title => 'Congo, the Democratic Republic of the')
98
+ Country.create(:code => 'CK', :title => 'Cook Islands')
99
+ Country.create(:code => 'CR', :title => 'Costa Rica')
100
+ Country.create(:code => 'CI', :title => 'Cote D\'Ivoire')
101
+ Country.create(:code => 'HR', :title => 'Croatia')
102
+ Country.create(:code => 'CU', :title => 'Cuba')
103
+ Country.create(:code => 'CY', :title => 'Cyprus')
104
+ Country.create(:code => 'CZ', :title => 'Czech Republic')
105
+ Country.create(:code => 'DK', :title => 'Denmark')
106
+ Country.create(:code => 'DJ', :title => 'Djibouti')
107
+ Country.create(:code => 'DM', :title => 'Dominica')
108
+ Country.create(:code => 'DO', :title => 'Dominican Republic')
109
+ Country.create(:code => 'EC', :title => 'Ecuador')
110
+ Country.create(:code => 'EG', :title => 'Egypt')
111
+ Country.create(:code => 'SV', :title => 'El Salvador')
112
+ Country.create(:code => 'GQ', :title => 'Equatorial Guinea')
113
+ Country.create(:code => 'ER', :title => 'Eritrea')
114
+ Country.create(:code => 'EE', :title => 'Estonia')
115
+ Country.create(:code => 'ET', :title => 'Ethiopia')
116
+ Country.create(:code => 'FK', :title => 'Falkland Islands (Malvinas)')
117
+ Country.create(:code => 'FO', :title => 'Faroe Islands')
118
+ Country.create(:code => 'FJ', :title => 'Fiji')
119
+ Country.create(:code => 'FI', :title => 'Finland')
120
+ Country.create(:code => 'FR', :title => 'France')
121
+ Country.create(:code => 'GF', :title => 'French Guiana')
122
+ Country.create(:code => 'PF', :title => 'French Polynesia')
123
+ Country.create(:code => 'GA', :title => 'Gabon')
124
+ Country.create(:code => 'GM', :title => 'Gambia')
125
+ Country.create(:code => 'GE', :title => 'Georgia')
126
+ Country.create(:code => 'DE', :title => 'Germany')
127
+ Country.create(:code => 'GH', :title => 'Ghana')
128
+ Country.create(:code => 'GI', :title => 'Gibraltar')
129
+ Country.create(:code => 'GR', :title => 'Greece')
130
+ Country.create(:code => 'GL', :title => 'Greenland')
131
+ Country.create(:code => 'GD', :title => 'Grenada')
132
+ Country.create(:code => 'GP', :title => 'Guadeloupe')
133
+ Country.create(:code => 'GU', :title => 'Guam')
134
+ Country.create(:code => 'GT', :title => 'Guatemala')
135
+ Country.create(:code => 'GN', :title => 'Guinea')
136
+ Country.create(:code => 'GW', :title => 'Guinea-Bissau')
137
+ Country.create(:code => 'GY', :title => 'Guyana')
138
+ Country.create(:code => 'HT', :title => 'Haiti')
139
+ Country.create(:code => 'VA', :title => 'Holy See (Vatican City State)')
140
+ Country.create(:code => 'HN', :title => 'Honduras')
141
+ Country.create(:code => 'HK', :title => 'Hong Kong')
142
+ Country.create(:code => 'HU', :title => 'Hungary')
143
+ Country.create(:code => 'IS', :title => 'Iceland')
144
+ Country.create(:code => 'IN', :title => 'India')
145
+ Country.create(:code => 'ID', :title => 'Indonesia')
146
+ Country.create(:code => 'IR', :title => 'Iran, Islamic Republic of')
147
+ Country.create(:code => 'IQ', :title => 'Iraq')
148
+ Country.create(:code => 'IE', :title => 'Ireland')
149
+ Country.create(:code => 'IL', :title => 'Israel')
150
+ Country.create(:code => 'IT', :title => 'Italy')
151
+ Country.create(:code => 'JM', :title => 'Jamaica')
152
+ Country.create(:code => 'JP', :title => 'Japan')
153
+ Country.create(:code => 'JO', :title => 'Jordan')
154
+ Country.create(:code => 'KZ', :title => 'Kazakhstan')
155
+ Country.create(:code => 'KE', :title => 'Kenya')
156
+ Country.create(:code => 'KI', :title => 'Kiribati')
157
+ Country.create(:code => 'KP', :title => 'Korea, Democratic People\'s Republic of')
158
+ Country.create(:code => 'KR', :title => 'Korea, Republic of')
159
+ Country.create(:code => 'KW', :title => 'Kuwait')
160
+ Country.create(:code => 'KG', :title => 'Kyrgyzstan')
161
+ Country.create(:code => 'LA', :title => 'Lao People\'s Democratic Republic')
162
+ Country.create(:code => 'LV', :title => 'Latvia')
163
+ Country.create(:code => 'LB', :title => 'Lebanon')
164
+ Country.create(:code => 'LS', :title => 'Lesotho')
165
+ Country.create(:code => 'LR', :title => 'Liberia')
166
+ Country.create(:code => 'LY', :title => 'Libyan Arab Jamahiriya')
167
+ Country.create(:code => 'LI', :title => 'Liechtenstein')
168
+ Country.create(:code => 'LT', :title => 'Lithuania')
169
+ Country.create(:code => 'LU', :title => 'Luxembourg')
170
+ Country.create(:code => 'MO', :title => 'Macao')
171
+ Country.create(:code => 'MK', :title => 'Macedonia, the Former Yugoslav Republic of')
172
+ Country.create(:code => 'MG', :title => 'Madagascar')
173
+ Country.create(:code => 'MW', :title => 'Malawi')
174
+ Country.create(:code => 'MY', :title => 'Malaysia')
175
+ Country.create(:code => 'MV', :title => 'Maldives')
176
+ Country.create(:code => 'ML', :title => 'Mali')
177
+ Country.create(:code => 'MT', :title => 'Malta')
178
+ Country.create(:code => 'MH', :title => 'Marshall Islands')
179
+ Country.create(:code => 'MQ', :title => 'Martinique')
180
+ Country.create(:code => 'MR', :title => 'Mauritania')
181
+ Country.create(:code => 'MU', :title => 'Mauritius')
182
+ Country.create(:code => 'MX', :title => 'Mexico')
183
+ Country.create(:code => 'FM', :title => 'Micronesia, Federated States of')
184
+ Country.create(:code => 'MD', :title => 'Moldova, Republic of')
185
+ Country.create(:code => 'MC', :title => 'Monaco')
186
+ Country.create(:code => 'MN', :title => 'Mongolia')
187
+ Country.create(:code => 'MS', :title => 'Montserrat')
188
+ Country.create(:code => 'MA', :title => 'Morocco')
189
+ Country.create(:code => 'MZ', :title => 'Mozambique')
190
+ Country.create(:code => 'MM', :title => 'Myanmar')
191
+ Country.create(:code => 'NA', :title => 'Namibia')
192
+ Country.create(:code => 'NR', :title => 'Nauru')
193
+ Country.create(:code => 'NP', :title => 'Nepal')
194
+ Country.create(:code => 'NL', :title => 'Netherlands')
195
+ Country.create(:code => 'AN', :title => 'Netherlands Antilles')
196
+ Country.create(:code => 'NC', :title => 'New Caledonia')
197
+ Country.create(:code => 'NZ', :title => 'New Zealand')
198
+ Country.create(:code => 'NI', :title => 'Nicaragua')
199
+ Country.create(:code => 'NE', :title => 'Niger')
200
+ Country.create(:code => 'NG', :title => 'Nigeria')
201
+ Country.create(:code => 'NU', :title => 'Niue')
202
+ Country.create(:code => 'NF', :title => 'Norfolk Island')
203
+ Country.create(:code => 'MP', :title => 'Northern Mariana Islands')
204
+ Country.create(:code => 'NO', :title => 'Norway')
205
+ Country.create(:code => 'OM', :title => 'Oman')
206
+ Country.create(:code => 'PK', :title => 'Pakistan')
207
+ Country.create(:code => 'PW', :title => 'Palau')
208
+ Country.create(:code => 'PA', :title => 'Panama')
209
+ Country.create(:code => 'PG', :title => 'Papua New Guinea')
210
+ Country.create(:code => 'PY', :title => 'Paraguay')
211
+ Country.create(:code => 'PE', :title => 'Peru')
212
+ Country.create(:code => 'PH', :title => 'Philippines')
213
+ Country.create(:code => 'PN', :title => 'Pitcairn')
214
+ Country.create(:code => 'PL', :title => 'Poland')
215
+ Country.create(:code => 'PT', :title => 'Portugal')
216
+ Country.create(:code => 'PR', :title => 'Puerto Rico')
217
+ Country.create(:code => 'QA', :title => 'Qatar')
218
+ Country.create(:code => 'RE', :title => 'Reunion')
219
+ Country.create(:code => 'RO', :title => 'Romania')
220
+ Country.create(:code => 'RU', :title => 'Russian Federation')
221
+ Country.create(:code => 'RW', :title => 'Rwanda')
222
+ Country.create(:code => 'SH', :title => 'Saint Helena')
223
+ Country.create(:code => 'KN', :title => 'Saint Kitts and Nevis')
224
+ Country.create(:code => 'LC', :title => 'Saint Lucia')
225
+ Country.create(:code => 'PM', :title => 'Saint Pierre and Miquelon')
226
+ Country.create(:code => 'VC', :title => 'Saint Vincent and the Grenadines')
227
+ Country.create(:code => 'WS', :title => 'Samoa')
228
+ Country.create(:code => 'SM', :title => 'San Marino')
229
+ Country.create(:code => 'ST', :title => 'Sao Tome and Principe')
230
+ Country.create(:code => 'SA', :title => 'Saudi Arabia')
231
+ Country.create(:code => 'SN', :title => 'Senegal')
232
+ Country.create(:code => 'SC', :title => 'Seychelles')
233
+ Country.create(:code => 'SL', :title => 'Sierra Leone')
234
+ Country.create(:code => 'SG', :title => 'Singapore')
235
+ Country.create(:code => 'SK', :title => 'Slovakia')
236
+ Country.create(:code => 'SI', :title => 'Slovenia')
237
+ Country.create(:code => 'SB', :title => 'Solomon Islands')
238
+ Country.create(:code => 'SO', :title => 'Somalia')
239
+ Country.create(:code => 'ZA', :title => 'South Africa')
240
+ Country.create(:code => 'ES', :title => 'Spain')
241
+ Country.create(:code => 'LK', :title => 'Sri Lanka')
242
+ Country.create(:code => 'SD', :title => 'Sudan')
243
+ Country.create(:code => 'SR', :title => 'Suriname')
244
+ Country.create(:code => 'SJ', :title => 'Svalbard and Jan Mayen')
245
+ Country.create(:code => 'SZ', :title => 'Swaziland')
246
+ Country.create(:code => 'SE', :title => 'Sweden')
247
+ Country.create(:code => 'CH', :title => 'Switzerland')
248
+ Country.create(:code => 'SY', :title => 'Syrian Arab Republic')
249
+ Country.create(:code => 'TW', :title => 'Taiwan, Province of China')
250
+ Country.create(:code => 'TJ', :title => 'Tajikistan')
251
+ Country.create(:code => 'TZ', :title => 'Tanzania, United Republic of')
252
+ Country.create(:code => 'TH', :title => 'Thailand')
253
+ Country.create(:code => 'TG', :title => 'Togo')
254
+ Country.create(:code => 'TK', :title => 'Tokelau')
255
+ Country.create(:code => 'TO', :title => 'Tonga')
256
+ Country.create(:code => 'TT', :title => 'Trinidad and Tobago')
257
+ Country.create(:code => 'TN', :title => 'Tunisia')
258
+ Country.create(:code => 'TR', :title => 'Turkey')
259
+ Country.create(:code => 'TM', :title => 'Turkmenistan')
260
+ Country.create(:code => 'TC', :title => 'Turks and Caicos Islands')
261
+ Country.create(:code => 'TV', :title => 'Tuvalu')
262
+ Country.create(:code => 'UG', :title => 'Uganda')
263
+ Country.create(:code => 'UA', :title => 'Ukraine')
264
+ Country.create(:code => 'AE', :title => 'United Arab Emirates')
265
+ Country.create(:code => 'GB', :title => 'United Kingdom')
266
+ Country.create(:code => 'US', :title => 'United States', :active => true, :top_of_list => true)
267
+ Country.create(:code => 'UY', :title => 'Uruguay')
268
+ Country.create(:code => 'UZ', :title => 'Uzbekistan')
269
+ Country.create(:code => 'VU', :title => 'Vanuatu')
270
+ Country.create(:code => 'VE', :title => 'Venezuela')
271
+ Country.create(:code => 'VN', :title => 'Viet Nam')
272
+ Country.create(:code => 'VG', :title => 'Virgin Islands, British')
273
+ Country.create(:code => 'VI', :title => 'Virgin Islands, U.s.')
274
+ Country.create(:code => 'WF', :title => 'Wallis and Futuna')
275
+ Country.create(:code => 'EH', :title => 'Western Sahara')
276
+ Country.create(:code => 'YE', :title => 'Yemen')
277
+ Country.create(:code => 'ZM', :title => 'Zambia')
278
+ Country.create(:code => 'ZW', :title => 'Zimbabwe')
276
279
 
277
- # provinces and states
278
- country = Country.find_by_code("US")
279
- Province.create :title => 'Alabama', :code => 'AL', :country_id => country.id
280
- Province.create :title => 'Alaska', :code => 'AK', :country_id => country.id
281
- Province.create :title => 'Arizona', :code => 'AZ', :country_id => country.id
282
- Province.create :title => 'Arkansas', :code => 'AR', :country_id => country.id
283
- Province.create :title => 'California', :code => 'CA', :country_id => country.id
284
- Province.create :title => 'Colorado', :code => 'CO', :country_id => country.id
285
- Province.create :title => 'Connecticut', :code => 'CT', :country_id => country.id
286
- Province.create :title => 'Delaware', :code => 'DE', :country_id => country.id
287
- Province.create :title => 'District of Columbia', :code => 'DC', :country_id => country.id
288
- Province.create :title => 'Florida', :code => 'FL', :country_id => country.id
289
- Province.create :title => 'Georgia', :code => 'GA', :country_id => country.id
290
- Province.create :title => 'Hawaii', :code => 'HI', :country_id => country.id
291
- Province.create :title => 'Idaho', :code => 'ID', :country_id => country.id
292
- Province.create :title => 'Illinois', :code => 'IL', :country_id => country.id
293
- Province.create :title => 'Indiana', :code => 'IN', :country_id => country.id
294
- Province.create :title => 'Iowa', :code => 'IA', :country_id => country.id
295
- Province.create :title => 'Kansas', :code => 'KS', :country_id => country.id
296
- Province.create :title => 'Kentucky', :code => 'KY', :country_id => country.id
297
- Province.create :title => 'Louisiana', :code => 'LA', :country_id => country.id
298
- Province.create :title => 'Maine', :code => 'ME', :country_id => country.id
299
- Province.create :title => 'Maryland', :code => 'MD', :country_id => country.id
300
- Province.create :title => 'Massachutsetts', :code => 'MA', :country_id => country.id
301
- Province.create :title => 'Michigan', :code => 'MI', :country_id => country.id
302
- Province.create :title => 'Minnesota', :code => 'MN', :country_id => country.id
303
- Province.create :title => 'Mississippi', :code => 'MS', :country_id => country.id
304
- Province.create :title => 'Missouri', :code => 'MO', :country_id => country.id
305
- Province.create :title => 'Montana', :code => 'MT', :country_id => country.id
306
- Province.create :title => 'Nebraska', :code => 'NE', :country_id => country.id
307
- Province.create :title => 'Nevada', :code => 'NV', :country_id => country.id
308
- Province.create :title => 'New Hampshire', :code => 'NH', :country_id => country.id
309
- Province.create :title => 'New Jersey', :code => 'NJ', :country_id => country.id
310
- Province.create :title => 'New Mexico', :code => 'NM', :country_id => country.id
311
- Province.create :title => 'New York', :code => 'NY', :country_id => country.id
312
- Province.create :title => 'North Carolina', :code => 'NC', :country_id => country.id
313
- Province.create :title => 'North Dakota', :code => 'ND', :country_id => country.id
314
- Province.create :title => 'Ohio', :code => 'OH', :country_id => country.id
315
- Province.create :title => 'Oklahoma', :code => 'OK', :country_id => country.id
316
- Province.create :title => 'Oregon', :code => 'OR', :country_id => country.id
317
- Province.create :title => 'Pennsylvania', :code => 'PA', :country_id => country.id
318
- Province.create :title => 'Rhode Island', :code => 'RI', :country_id => country.id
319
- Province.create :title => 'South Carolina', :code => 'SC', :country_id => country.id
320
- Province.create :title => 'South Dakota', :code => 'SD', :country_id => country.id
321
- Province.create :title => 'Tennessee', :code => 'TN', :country_id => country.id
322
- Province.create :title => 'Texas', :code => 'TX', :country_id => country.id
323
- Province.create :title => 'Utah', :code => 'UT', :country_id => country.id
324
- Province.create :title => 'Vermont', :code => 'VT', :country_id => country.id
325
- Province.create :title => 'Virginia', :code => 'VA', :country_id => country.id
326
- Province.create :title => 'Washington', :code => 'WA', :country_id => country.id
327
- Province.create :title => 'West Virginia', :code => 'WV', :country_id => country.id
328
- Province.create :title => 'Wisconsin', :code => 'WI', :country_id => country.id
329
- Province.create :title => 'Wyoming', :code => 'WY', :country_id => country.id
280
+ # provinces and states
281
+ country = Country.find_by_code("US")
282
+ Province.create :title => 'Alabama', :code => 'AL', :country_id => country.id
283
+ Province.create :title => 'Alaska', :code => 'AK', :country_id => country.id
284
+ Province.create :title => 'Arizona', :code => 'AZ', :country_id => country.id
285
+ Province.create :title => 'Arkansas', :code => 'AR', :country_id => country.id
286
+ Province.create :title => 'California', :code => 'CA', :country_id => country.id
287
+ Province.create :title => 'Colorado', :code => 'CO', :country_id => country.id
288
+ Province.create :title => 'Connecticut', :code => 'CT', :country_id => country.id
289
+ Province.create :title => 'Delaware', :code => 'DE', :country_id => country.id
290
+ Province.create :title => 'District of Columbia', :code => 'DC', :country_id => country.id
291
+ Province.create :title => 'Florida', :code => 'FL', :country_id => country.id
292
+ Province.create :title => 'Georgia', :code => 'GA', :country_id => country.id
293
+ Province.create :title => 'Hawaii', :code => 'HI', :country_id => country.id
294
+ Province.create :title => 'Idaho', :code => 'ID', :country_id => country.id
295
+ Province.create :title => 'Illinois', :code => 'IL', :country_id => country.id
296
+ Province.create :title => 'Indiana', :code => 'IN', :country_id => country.id
297
+ Province.create :title => 'Iowa', :code => 'IA', :country_id => country.id
298
+ Province.create :title => 'Kansas', :code => 'KS', :country_id => country.id
299
+ Province.create :title => 'Kentucky', :code => 'KY', :country_id => country.id
300
+ Province.create :title => 'Louisiana', :code => 'LA', :country_id => country.id
301
+ Province.create :title => 'Maine', :code => 'ME', :country_id => country.id
302
+ Province.create :title => 'Maryland', :code => 'MD', :country_id => country.id
303
+ Province.create :title => 'Massachutsetts', :code => 'MA', :country_id => country.id
304
+ Province.create :title => 'Michigan', :code => 'MI', :country_id => country.id
305
+ Province.create :title => 'Minnesota', :code => 'MN', :country_id => country.id
306
+ Province.create :title => 'Mississippi', :code => 'MS', :country_id => country.id
307
+ Province.create :title => 'Missouri', :code => 'MO', :country_id => country.id
308
+ Province.create :title => 'Montana', :code => 'MT', :country_id => country.id
309
+ Province.create :title => 'Nebraska', :code => 'NE', :country_id => country.id
310
+ Province.create :title => 'Nevada', :code => 'NV', :country_id => country.id
311
+ Province.create :title => 'New Hampshire', :code => 'NH', :country_id => country.id
312
+ Province.create :title => 'New Jersey', :code => 'NJ', :country_id => country.id
313
+ Province.create :title => 'New Mexico', :code => 'NM', :country_id => country.id
314
+ Province.create :title => 'New York', :code => 'NY', :country_id => country.id
315
+ Province.create :title => 'North Carolina', :code => 'NC', :country_id => country.id
316
+ Province.create :title => 'North Dakota', :code => 'ND', :country_id => country.id
317
+ Province.create :title => 'Ohio', :code => 'OH', :country_id => country.id
318
+ Province.create :title => 'Oklahoma', :code => 'OK', :country_id => country.id
319
+ Province.create :title => 'Oregon', :code => 'OR', :country_id => country.id
320
+ Province.create :title => 'Pennsylvania', :code => 'PA', :country_id => country.id
321
+ Province.create :title => 'Rhode Island', :code => 'RI', :country_id => country.id
322
+ Province.create :title => 'South Carolina', :code => 'SC', :country_id => country.id
323
+ Province.create :title => 'South Dakota', :code => 'SD', :country_id => country.id
324
+ Province.create :title => 'Tennessee', :code => 'TN', :country_id => country.id
325
+ Province.create :title => 'Texas', :code => 'TX', :country_id => country.id
326
+ Province.create :title => 'Utah', :code => 'UT', :country_id => country.id
327
+ Province.create :title => 'Vermont', :code => 'VT', :country_id => country.id
328
+ Province.create :title => 'Virginia', :code => 'VA', :country_id => country.id
329
+ Province.create :title => 'Washington', :code => 'WA', :country_id => country.id
330
+ Province.create :title => 'West Virginia', :code => 'WV', :country_id => country.id
331
+ Province.create :title => 'Wisconsin', :code => 'WI', :country_id => country.id
332
+ Province.create :title => 'Wyoming', :code => 'WY', :country_id => country.id
330
333
 
331
- country = Country.find_by_code("CA")
332
- Province.create :title => "Alberta", :code => "AB", :country_id => country.id
333
- Province.create :title => "British Columbia", :code => "BC", :country_id => country.id
334
- Province.create :title => "Manitoba", :code => "MB", :country_id => country.id
335
- Province.create :title => "New Brunswick", :code => "NB", :country_id => country.id
336
- Province.create :title => "Newfoundland and Labrador", :code => "NL", :country_id => country.id
337
- Province.create :title => "Nova Scotia", :code => "NS", :country_id => country.id
338
- Province.create :title => "Ontario", :code => "ON", :country_id => country.id
339
- Province.create :title => "Prince Edward Island", :code => "PE", :country_id => country.id
340
- Province.create :title => "Quebec", :code => "QC", :country_id => country.id
341
- Province.create :title => "Saskatchewan", :code => "SK", :country_id => country.id
342
- Province.create :title => "Northwest Territories", :code => "NT", :country_id => country.id
343
- Province.create :title => "Nunavut", :code => "NU", :country_id => country.id
344
- Province.create :title => "Yukon", :code => "YT", :country_id => country.id
334
+ country = Country.find_by_code("CA")
335
+ Province.create :title => "Alberta", :code => "AB", :country_id => country.id
336
+ Province.create :title => "British Columbia", :code => "BC", :country_id => country.id
337
+ Province.create :title => "Manitoba", :code => "MB", :country_id => country.id
338
+ Province.create :title => "New Brunswick", :code => "NB", :country_id => country.id
339
+ Province.create :title => "Newfoundland and Labrador", :code => "NL", :country_id => country.id
340
+ Province.create :title => "Nova Scotia", :code => "NS", :country_id => country.id
341
+ Province.create :title => "Ontario", :code => "ON", :country_id => country.id
342
+ Province.create :title => "Prince Edward Island", :code => "PE", :country_id => country.id
343
+ Province.create :title => "Quebec", :code => "QC", :country_id => country.id
344
+ Province.create :title => "Saskatchewan", :code => "SK", :country_id => country.id
345
+ Province.create :title => "Northwest Territories", :code => "NT", :country_id => country.id
346
+ Province.create :title => "Nunavut", :code => "NU", :country_id => country.id
347
+ Province.create :title => "Yukon", :code => "YT", :country_id => country.id
348
+ rescue StandardError => e
349
+ puts "Countries and/or provinces were not created due to error: #{e}. You may not have installed the ecommerce module. If so, don't worry about this error."
350
+ end