spree_br_common 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/.rspec +1 -0
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +14 -0
  7. data/Gemfile +20 -0
  8. data/LICENSE +26 -0
  9. data/README.md +55 -0
  10. data/Rakefile +21 -0
  11. data/app/assets/javascripts/spree/backend/spree_br_common.js +2 -0
  12. data/app/assets/javascripts/spree/frontend/address.js +119 -0
  13. data/app/assets/javascripts/spree/frontend/mask.js +21 -0
  14. data/app/assets/javascripts/spree/frontend/plugins/jquery.mask.extension.js +4 -0
  15. data/app/assets/javascripts/spree/frontend/plugins/jquery.mask.js +395 -0
  16. data/app/assets/javascripts/spree/frontend/routes.js.erb +4 -0
  17. data/app/assets/javascripts/spree/frontend/spree_br_common.js +1 -0
  18. data/app/assets/stylesheets/spree/backend/spree_br_common.css +4 -0
  19. data/app/assets/stylesheets/spree/frontend/spree_br_common.css +4 -0
  20. data/app/controllers/spree/addresses_controller.rb +24 -0
  21. data/app/controllers/spree/api/cities_controller.rb +38 -0
  22. data/app/controllers/spree/user_registrations_controller_decorator.rb +13 -0
  23. data/app/helpers/spree/api/api_helpers_decorator.rb +13 -0
  24. data/app/helpers/spree/base_helper_decorator.rb +5 -0
  25. data/app/models/spree/ability_decorator.rb +21 -0
  26. data/app/models/spree/address_decorator.rb +6 -0
  27. data/app/models/spree/city.rb +7 -0
  28. data/app/models/spree/permitted_attributes_decorator.rb +8 -0
  29. data/app/models/spree/state_decorator.rb +3 -0
  30. data/app/models/spree/user_decorator.rb +52 -0
  31. data/app/overrides/spree/address/_form/add_district.html.erb.deface +5 -0
  32. data/app/overrides/spree/address/_form/add_number.html.erb.deface +5 -0
  33. data/app/overrides/spree/address/_form/hide_country.html.erb.deface +4 -0
  34. data/app/overrides/spree/address/_form/move_city_to_after_state.deface +2 -0
  35. data/app/overrides/spree/address/_form/move_zipcode_after_last_name.deface +2 -0
  36. data/app/overrides/spree/address/_form/replace_city_input_text_by_select.html.erb.deface +18 -0
  37. data/app/overrides/spree/address/_form/set_data_uf_to_state.html.erb.deface +15 -0
  38. data/app/overrides/spree/admin/users/_form/add_extras_fields.html.erb.deface +39 -0
  39. data/app/overrides/spree/shared/_user_form/add_extra_fields.html.erb.deface +19 -0
  40. data/app/overrides/spree/users/show/add_details.html.erb.deface +13 -0
  41. data/app/views/spree/api/cities/index.v1.rabl +11 -0
  42. data/app/views/spree/api/cities/show.v1.rabl +2 -0
  43. data/bin/rails +7 -0
  44. data/config/locales/en.yml +11 -0
  45. data/config/locales/pt-BR.yml +14 -0
  46. data/config/routes.rb +7 -0
  47. data/db/default/country.rb +3 -0
  48. data/db/default/shipping_categories.rb +1 -0
  49. data/db/default/shipping_zones.rb +3 -0
  50. data/db/default/states.rb +31 -0
  51. data/db/default/states_cities_of_acre.rb +26 -0
  52. data/db/default/states_cities_of_alagoas.rb +107 -0
  53. data/db/default/states_cities_of_amapa.rb +20 -0
  54. data/db/default/states_cities_of_amazonas.rb +67 -0
  55. data/db/default/states_cities_of_bahia.rb +421 -0
  56. data/db/default/states_cities_of_ceara.rb +188 -0
  57. data/db/default/states_cities_of_distrito_federal.rb +5 -0
  58. data/db/default/states_cities_of_espirito_santo.rb +82 -0
  59. data/db/default/states_cities_of_goias.rb +250 -0
  60. data/db/default/states_cities_of_maranhao.rb +221 -0
  61. data/db/default/states_cities_of_mato_grosso.rb +145 -0
  62. data/db/default/states_cities_of_mato_grosso_do_sul.rb +82 -0
  63. data/db/default/states_cities_of_minas_gerais.rb +857 -0
  64. data/db/default/states_cities_of_para.rb +147 -0
  65. data/db/default/states_cities_of_paraiba.rb +227 -0
  66. data/db/default/states_cities_of_parana.rb +403 -0
  67. data/db/default/states_cities_of_pernambuco.rb +189 -0
  68. data/db/default/states_cities_of_piaui.rb +227 -0
  69. data/db/default/states_cities_of_rio_de_janeiro.rb +96 -0
  70. data/db/default/states_cities_of_rio_grande_do_norte.rb +171 -0
  71. data/db/default/states_cities_of_rio_grande_do_sul.rb +500 -0
  72. data/db/default/states_cities_of_rondonia.rb +56 -0
  73. data/db/default/states_cities_of_roraima.rb +19 -0
  74. data/db/default/states_cities_of_santa_catarina.rb +297 -0
  75. data/db/default/states_cities_of_sao_paulo.rb +649 -0
  76. data/db/default/states_cities_of_sergipe.rb +79 -0
  77. data/db/default/states_cities_of_tocantins.rb +144 -0
  78. data/db/default/stock.rb +1 -0
  79. data/db/default/tax_categories.rb +1 -0
  80. data/db/default/user.rb +100 -0
  81. data/db/migrate/20150503011715_create_spree_cities.rb +13 -0
  82. data/db/migrate/20150504004509_remove_city_from_spree_address.rb +5 -0
  83. data/db/migrate/20150504004648_add_city_to_spree_address.rb +5 -0
  84. data/db/migrate/20150505020218_add_number_and_district_to_spree_address.rb +6 -0
  85. data/db/migrate/20150505031019_add_details_to_spree_user.rb +10 -0
  86. data/db/seeds.rb +5 -0
  87. data/lib/generators/spree_br_common/install/install_generator.rb +31 -0
  88. data/lib/spree_br_common/engine.rb +20 -0
  89. data/lib/spree_br_common/factories/address_factory.rb +7 -0
  90. data/lib/spree_br_common/factories/city_factory.rb +8 -0
  91. data/lib/spree_br_common/factories/user_factory.rb +12 -0
  92. data/lib/spree_br_common/factories.rb +3 -0
  93. data/lib/spree_br_common.rb +2 -0
  94. data/spec/controllers/features/address_checkout_spec.rb +89 -0
  95. data/spec/controllers/features/user_account_spec.rb +46 -0
  96. data/spec/controllers/features/user_signup_spec.rb +24 -0
  97. data/spec/controllers/spree/addresses_controller_spec.rb +27 -0
  98. data/spec/controllers/spree/api/cities_controller_spec.rb +86 -0
  99. data/spec/fixtures/vcr_cassettes/Checkout/visitor_makes_checkout_as_guest_without_registration/full_checkout/does_not_break_the_per-item_shipping_method_calculator.yml +49 -0
  100. data/spec/fixtures/vcr_cassettes/Checkout/visitor_makes_checkout_as_guest_without_registration/full_checkout/in_Brazil/should_autocomplete_zipcode.yml +46 -0
  101. data/spec/fixtures/vcr_cassettes/Spree_AddressesController/_show/does_not_find_an_incorrect_cep.yml +38 -0
  102. data/spec/fixtures/vcr_cassettes/Spree_AddressesController/_show/shows_the_correct_address.yml +46 -0
  103. data/spec/models/spree/address_spec.rb +32 -0
  104. data/spec/models/spree/city_spec.rb +7 -0
  105. data/spec/models/spree/user_spec.rb +88 -0
  106. data/spec/spec_helper.rb +94 -0
  107. data/spec/support/controller_hacks.rb +33 -0
  108. data/spec/support/shared_context/checkout_setup.rb +9 -0
  109. data/spec/support/vcr.rb +8 -0
  110. data/spree_br_common.gemspec +33 -0
  111. metadata +351 -0
@@ -0,0 +1,15 @@
1
+ <!-- replace 'erb:contains("state_elements = [")' -->
2
+ <% states = address.country.states.map{ |s| [s.name, s.id, {'data-uf'=>s.abbr}]} %>
3
+ <% state_elements = [
4
+ form.select(
5
+ :state_id,
6
+ options_for_select(states, address.state ? address.state.id: nil),
7
+ {:include_blank => false},
8
+ {:class => 'ajax-loading form-control ' + (have_states ? 'required' : 'hidden'),
9
+ :disabled => !have_states}
10
+ ) +
11
+ form.text_field(:state_name,
12
+ :class => !have_states ? 'form-control required' : 'form-control hidden',
13
+ :disabled => have_states)
14
+ ].join.gsub('"', "'").gsub("\n", "")
15
+ %>
@@ -0,0 +1,39 @@
1
+ <!-- insert_top '[data-hook="admin_user_form_fields"]' -->
2
+ <div class="col-md-6">
3
+ <%= f.field_container :first_name do %>
4
+ <%= f.label :first_name, Spree.t(:first_name) %>
5
+ <%= f.text_field :first_name, :class => 'fullwidth' %>
6
+ <%= f.error_message_on :first_name %>
7
+ <% end %>
8
+
9
+ <%= f.field_container :cpf do %>
10
+ <%= f.label :cpf, Spree.t(:cpf) %>
11
+ <%= f.text_field :cpf, :class => 'fullwidth' %>
12
+ <%= f.error_message_on :cpf %>
13
+ <% end %>
14
+
15
+ <%= f.field_container :phone do %>
16
+ <%= f.label :phone, Spree.t(:phone) %>
17
+ <%= f.text_field :phone, :class => 'fullwidth' %>
18
+ <%= f.error_message_on :phone %>
19
+ <% end %>
20
+ </div>
21
+ <div class="col-md-6">
22
+ <%= f.field_container :last_name do %>
23
+ <%= f.label :last_name, Spree.t(:last_name) %>
24
+ <%= f.text_field :last_name, :class => 'fullwidth' %>
25
+ <%= f.error_message_on :last_name %>
26
+ <% end %>
27
+
28
+ <%= f.field_container :date_of_birth do %>
29
+ <%= f.label :date_of_birth, Spree.t(:date_of_birth) %>
30
+ <%= f.date_field :date_of_birth, :class => 'fullwidth' %>
31
+ <%= f.error_message_on :date_of_birth %>
32
+ <% end %>
33
+
34
+ <%= f.field_container :alternative_phone do %>
35
+ <%= f.label :alternative_phone, Spree.t(:alternative_phone) %>
36
+ <%= f.text_field :alternative_phone, :class => 'fullwidth' %>
37
+ <%= f.error_message_on :alternative_phone %>
38
+ <% end %>
39
+ </div>
@@ -0,0 +1,19 @@
1
+ <!-- insert_top '#password-credentials' -->
2
+ <div class="form-group">
3
+ <%= f.text_field :first_name, :class => 'form-control', :placeholder => Spree.t(:first_name), :maxlength => 100 %>
4
+ </div>
5
+ <div class="form-group">
6
+ <%= f.text_field :last_name, :class => 'form-control', :placeholder => Spree.t(:last_name), :maxlength => 100 %>
7
+ </div>
8
+ <div class="form-group">
9
+ <%= f.text_field :cpf, :class => 'form-control', :placeholder => Spree.t(:cpf), :maxlength => 14, :'data-mask' => '000.000.000-00' %>
10
+ </div>
11
+ <div class="form-group">
12
+ <%= f.text_field :date_of_birth, :class => 'form-control datepicker', :value => datepicker_value(@user, :date_of_birth), :'data-mask' => Spree.t('date_picker.js_mask'), :placeholder => Spree.t(:date_of_birth) %>
13
+ </div>
14
+ <div class="form-group">
15
+ <%= f.telephone_field :phone, :class => 'form-control', :placeholder => Spree.t(:phone), :maxlength => 12 %>
16
+ </div>
17
+ <div class="form-group">
18
+ <%= f.telephone_field :alternative_phone, :class => 'form-control', :placeholder => Spree.t(:alternative_phone), :maxlength => 16 %>
19
+ </div>
@@ -0,0 +1,13 @@
1
+ <!-- insert_top '#user-info' -->
2
+ <dt><%= Spree.t(:full_name) %></dt>
3
+ <dd><%= @user.full_name %></dd>
4
+ <dt><%= Spree.t(:cpf) %></dt>
5
+ <dd><%= @user.cpf_formatted %></dd>
6
+ <dt><%= Spree.t(:date_of_birth) %></dt>
7
+ <dd><%= @user.date_of_birth.to_date %></dd>
8
+ <dt><%= Spree.t(:phone) %></dt>
9
+ <dd><%= number_to_phone(@user.phone) %></dd>
10
+ <% if @user.alternative_phone.present? %>
11
+ <dt><%= Spree.t(:alternative_phone) %></dt>
12
+ <dd><%= @user.alternative_phone %></dd>
13
+ <% end %>
@@ -0,0 +1,11 @@
1
+ object false
2
+
3
+ child(@cities => :cities) do
4
+ attributes *city_attributes
5
+ end
6
+
7
+ if @cities.respond_to?(:num_pages)
8
+ node(:count) { @cities.count }
9
+ node(:current_page) { params[:page] || 1 }
10
+ node(:pages) { @cities.num_pages }
11
+ end
@@ -0,0 +1,2 @@
1
+ object @city
2
+ attributes *city_attributes
data/bin/rails ADDED
@@ -0,0 +1,7 @@
1
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
2
+
3
+ ENGINE_ROOT = File.expand_path('../..', __FILE__)
4
+ ENGINE_PATH = File.expand_path('../../lib/spree_br_common/engine', __FILE__)
5
+
6
+ require 'rails/all'
7
+ require 'rails/engine/commands'
@@ -0,0 +1,11 @@
1
+ en:
2
+ activerecord:
3
+ attributes:
4
+ spree/user:
5
+ cpf: CPF
6
+ spree:
7
+ date_picker:
8
+ js_mask: 0000/00/00
9
+ format: '%Y/%m/%d'
10
+ cpf: CPF
11
+ date_of_birth: Date Of Birth
@@ -0,0 +1,14 @@
1
+ pt-BR:
2
+ activerecord:
3
+ attributes:
4
+ spree/address:
5
+ number: Número
6
+ district: Bairro
7
+ spree/user:
8
+ cpf: CPF
9
+ date_of_birth: Data de Nascimento
10
+ spree:
11
+ date_picker:
12
+ js_mask: 00/00/0000
13
+ format: '%d/%m/%Y'
14
+ full_name: Nome Completo
data/config/routes.rb ADDED
@@ -0,0 +1,7 @@
1
+ Spree::Core::Engine.routes.draw do
2
+ namespace :api, :defaults => { :format => 'json' } do
3
+ resources :cities, :only => [:index, :show]
4
+ end
5
+
6
+ get '/addresses(/*cep)', to: 'addresses#show', as: :address_show
7
+ end
@@ -0,0 +1,3 @@
1
+ country = Spree::Country.create!(name: 'Brasil', iso3: 'BRA', iso: 'BR', iso_name: 'BRAZIL', numcode: '76', states_required: true)
2
+
3
+ Spree::Config[:default_country_id] = country.id
@@ -0,0 +1 @@
1
+ Spree::ShippingCategory.create!(:name => 'Padrão')
@@ -0,0 +1,3 @@
1
+ brazil = Spree::Zone.create!(name: 'Brasil', description: 'Zona nacional')
2
+
3
+ brazil.zone_members.create!(zoneable: Spree::Country.find_by!(iso: 'BR'))
@@ -0,0 +1,31 @@
1
+ country = Spree::Country.find_by(iso: 'BR')
2
+
3
+ Spree::State.create!([
4
+ { name: 'Acre', abbr: 'AC', country: country},
5
+ { name: 'Alagoas', abbr: 'AL', country: country},
6
+ { name: 'Amapá', abbr: 'AP', country: country},
7
+ { name: 'Amazonas', abbr: 'AM', country: country},
8
+ { name: 'Bahia', abbr: 'BA', country: country},
9
+ { name: 'Ceará', abbr: 'CE', country: country},
10
+ { name: 'Distrito Federal', abbr: 'DF', country: country},
11
+ { name: 'Espírito Santo', abbr: 'ES', country: country},
12
+ { name: 'Goiás', abbr: 'GO', country: country},
13
+ { name: 'Maranhão', abbr: 'MA', country: country},
14
+ { name: 'Mato Grosso', abbr: 'MT', country: country},
15
+ { name: 'Mato Grosso do Sul', abbr: 'MS', country: country},
16
+ { name: 'Minas Gerais', abbr: 'MG', country: country},
17
+ { name: 'Pará', abbr: 'PA', country: country},
18
+ { name: 'Paraíba', abbr: 'PB', country: country},
19
+ { name: 'Paraná', abbr: 'PR', country: country},
20
+ { name: 'Pernambuco', abbr: 'PE', country: country},
21
+ { name: 'Piauí', abbr: 'PI', country: country},
22
+ { name: 'Rio de Janeiro', abbr: 'RJ', country: country},
23
+ { name: 'Rio Grande do Norte', abbr: 'RN', country: country},
24
+ { name: 'Rio Grande do Sul', abbr: 'RS', country: country},
25
+ { name: 'Rondônia', abbr: 'RO', country: country},
26
+ { name: 'Roraima', abbr: 'RR', country: country},
27
+ { name: 'Santa Catarina', abbr: 'SC', country: country},
28
+ { name: 'São Paulo', abbr: 'SP', country: country},
29
+ { name: 'Sergipe', abbr: 'SE', country: country},
30
+ { name: 'Tocantins', abbr: 'TO', country: country}
31
+ ])
@@ -0,0 +1,26 @@
1
+ acre = Spree::State.find_by! abbr: 'AC'
2
+
3
+ Spree::City.create!([
4
+ {state:acre, ibge_code:1200054, name: 'Assis Brasil'},
5
+ {state:acre, ibge_code:1200252, name: 'Epitaciolândia'},
6
+ {state:acre, ibge_code:1200344, name: 'Manoel Urbano'},
7
+ {state:acre, ibge_code:1200179, name: 'Capixaba'},
8
+ {state:acre, ibge_code:1200807, name: 'Porto Acre'},
9
+ {state:acre, ibge_code:1200708, name: 'Xapuri'},
10
+ {state:acre, ibge_code:1200203, name: 'Cruzeiro do Sul'},
11
+ {state:acre, ibge_code:1200336, name: 'Mâncio Lima'},
12
+ {state:acre, ibge_code:1200351, name: 'Marechal Thaumaturgo'},
13
+ {state:acre, ibge_code:1200393, name: 'Porto Walter'},
14
+ {state:acre, ibge_code:1200427, name: 'Rodrigues Alves'},
15
+ {state:acre, ibge_code:1200328, name: 'Jordão'},
16
+ {state:acre, ibge_code:1200609, name: 'Tarauacá'},
17
+ {state:acre, ibge_code:1200435, name: 'Santa Rosa do Purus'},
18
+ {state:acre, ibge_code:1200500, name: 'Sena Madureira'},
19
+ {state:acre, ibge_code:1200013, name: 'Acrelândia'},
20
+ {state:acre, ibge_code:1200138, name: 'Bujari'},
21
+ {state:acre, ibge_code:1200385, name: 'Plácido de Castro'},
22
+ {state:acre, ibge_code:1200401, name: 'Rio Branco'},
23
+ {state:acre, ibge_code:1200450, name: 'Senador Guiomard'},
24
+ {state:acre, ibge_code:1200104, name: 'Brasiléia'},
25
+ {state:acre, ibge_code:1200302, name: 'Feijó'}
26
+ ])
@@ -0,0 +1,107 @@
1
+ alagoas = Spree::State.find_by! abbr: 'AL'
2
+
3
+ Spree::City.create!([
4
+ {state: alagoas, ibge_code: 2704609, name: 'Maravilha'},
5
+ {state: alagoas, ibge_code: 2700805, name: 'Belém'},
6
+ {state: alagoas, ibge_code: 2702900, name: 'Girau do Ponciano'},
7
+ {state: alagoas, ibge_code: 2702801, name: 'Flexeiras'},
8
+ {state: alagoas, ibge_code: 2702207, name: 'Coqueiro Seco'},
9
+ {state: alagoas, ibge_code: 2700607, name: 'Barra de São Miguel'},
10
+ {state: alagoas, ibge_code: 2704302, name: 'Maceió'},
11
+ {state: alagoas, ibge_code: 2704708, name: 'Marechal Deodoro'},
12
+ {state: alagoas, ibge_code: 2706448, name: 'Paripueira'},
13
+ {state: alagoas, ibge_code: 2707701, name: 'Rio Largo'},
14
+ {state: alagoas, ibge_code: 2707909, name: 'Santa Luzia do Norte'},
15
+ {state: alagoas, ibge_code: 2708907, name: 'Satuba'},
16
+ {state: alagoas, ibge_code: 2701001, name: 'Boca da Mata'},
17
+ {state: alagoas, ibge_code: 2701407, name: 'Campo Alegre'},
18
+ {state: alagoas, ibge_code: 2703759, name: 'Jequiá da Praia'},
19
+ {state: alagoas, ibge_code: 2704005, name: 'Junqueiro'},
20
+ {state: alagoas, ibge_code: 2707800, name: 'Roteiro'},
21
+ {state: alagoas, ibge_code: 2708600, name: 'São Miguel dos Campos'},
22
+ {state: alagoas, ibge_code: 2702702, name: 'Feliz Deserto'},
23
+ {state: alagoas, ibge_code: 2703205, name: 'Igreja Nova'},
24
+ {state: alagoas, ibge_code: 2706703, name: 'Penedo'},
25
+ {state: alagoas, ibge_code: 2706802, name: 'Piaçabuçu'},
26
+ {state: alagoas, ibge_code: 2707503, name: 'Porto Real do Colégio'},
27
+ {state: alagoas, ibge_code: 2703304, name: 'Inhapi'},
28
+ {state: alagoas, ibge_code: 2705804, name: "Olho d'Água do Casado"},
29
+ {state: alagoas, ibge_code: 2706208, name: 'Palestina'},
30
+ {state: alagoas, ibge_code: 2708402, name: 'São José da Tapera'},
31
+ {state: alagoas, ibge_code: 2704401, name: 'Major Isidoro'},
32
+ {state: alagoas, ibge_code: 2701209, name: 'Cacimbinhas'},
33
+ {state: alagoas, ibge_code: 2704906, name: 'Mar Vermelho'},
34
+ {state: alagoas, ibge_code: 2709004, name: "Tanque d'Arca"},
35
+ {state: alagoas, ibge_code: 2702603, name: 'Feira Grande'},
36
+ {state: alagoas, ibge_code: 2709103, name: 'Taquarana'},
37
+ {state: alagoas, ibge_code: 2701902, name: 'Chã Preta'},
38
+ {state: alagoas, ibge_code: 2708303, name: 'São José da Laje'},
39
+ {state: alagoas, ibge_code: 2701357, name: 'Campestre'},
40
+ {state: alagoas, ibge_code: 2703502, name: 'Jacuípe'},
41
+ {state: alagoas, ibge_code: 2705200, name: 'Messias'},
42
+ {state: alagoas, ibge_code: 2708501, name: 'São Luís do Quitunde'},
43
+ {state: alagoas, ibge_code: 2700508, name: 'Barra de Santo Antônio'},
44
+ {state: alagoas, ibge_code: 2706901, name: 'Pilar'},
45
+ {state: alagoas, ibge_code: 2700201, name: 'Anadia'},
46
+ {state: alagoas, ibge_code: 2702306, name: 'Coruripe'},
47
+ {state: alagoas, ibge_code: 2709152, name: 'Teotônio Vilela'},
48
+ {state: alagoas, ibge_code: 2700904, name: 'Belo Monte'},
49
+ {state: alagoas, ibge_code: 2701100, name: 'Branquinha'},
50
+ {state: alagoas, ibge_code: 2700102, name: 'Água Branca'},
51
+ {state: alagoas, ibge_code: 2701605, name: 'Canapi'},
52
+ {state: alagoas, ibge_code: 2705002, name: 'Mata Grande'},
53
+ {state: alagoas, ibge_code: 2706422, name: 'Pariconha'},
54
+ {state: alagoas, ibge_code: 2702405, name: 'Delmiro Gouveia'},
55
+ {state: alagoas, ibge_code: 2707107, name: 'Piranhas'},
56
+ {state: alagoas, ibge_code: 2701803, name: 'Carneiros'},
57
+ {state: alagoas, ibge_code: 2702504, name: 'Dois Riachos'},
58
+ {state: alagoas, ibge_code: 2706109, name: 'Ouro Branco'},
59
+ {state: alagoas, ibge_code: 2706406, name: 'Pão de Açúcar'},
60
+ {state: alagoas, ibge_code: 2707206, name: 'Poço das Trincheiras'},
61
+ {state: alagoas, ibge_code: 2708006, name: 'Santana do Ipanema'},
62
+ {state: alagoas, ibge_code: 2708956, name: 'Senador Rui Palmeira'},
63
+ {state: alagoas, ibge_code: 2700706, name: 'Batalha'},
64
+ {state: alagoas, ibge_code: 2703403, name: 'Jacaré dos Homens'},
65
+ {state: alagoas, ibge_code: 2703700, name: 'Jaramataia'},
66
+ {state: alagoas, ibge_code: 2705408, name: 'Monteirópolis'},
67
+ {state: alagoas, ibge_code: 2705705, name: "Olho d'Água das Flores"},
68
+ {state: alagoas, ibge_code: 2706000, name: 'Olivença'},
69
+ {state: alagoas, ibge_code: 2702553, name: 'Estrela de alagoas'},
70
+ {state: alagoas, ibge_code: 2703106, name: 'Igaci'},
71
+ {state: alagoas, ibge_code: 2704807, name: 'Maribondo'},
72
+ {state: alagoas, ibge_code: 2705309, name: 'Minador do Negrão'},
73
+ {state: alagoas, ibge_code: 2706307, name: 'Palmeira dos Índios'},
74
+ {state: alagoas, ibge_code: 2706604, name: 'Paulo Jacinto'},
75
+ {state: alagoas, ibge_code: 2707602, name: 'Quebrangulo'},
76
+ {state: alagoas, ibge_code: 2700300, name: 'Arapiraca'},
77
+ {state: alagoas, ibge_code: 2701506, name: 'Campo Grande'},
78
+ {state: alagoas, ibge_code: 2702009, name: 'Coité do Nóia'},
79
+ {state: alagoas, ibge_code: 2702355, name: 'Craíbas'},
80
+ {state: alagoas, ibge_code: 2704104, name: 'Lagoa da Canoa'},
81
+ {state: alagoas, ibge_code: 2704203, name: 'Limoeiro de Anadia'},
82
+ {state: alagoas, ibge_code: 2708808, name: 'São Sebastião'},
83
+ {state: alagoas, ibge_code: 2705903, name: "Olho d'Água Grande"},
84
+ {state: alagoas, ibge_code: 2708204, name: 'São Brás'},
85
+ {state: alagoas, ibge_code: 2709202, name: 'Traipu'},
86
+ {state: alagoas, ibge_code: 2703007, name: 'Ibateguara'},
87
+ {state: alagoas, ibge_code: 2707008, name: 'Pindoba'},
88
+ {state: alagoas, ibge_code: 2708105, name: 'Santana do Mundaú'},
89
+ {state: alagoas, ibge_code: 2709301, name: 'União dos Palmares'},
90
+ {state: alagoas, ibge_code: 2709400, name: 'Viçosa'},
91
+ {state: alagoas, ibge_code: 2700409, name: 'Atalaia'},
92
+ {state: alagoas, ibge_code: 2701308, name: 'Cajueiro'},
93
+ {state: alagoas, ibge_code: 2701704, name: 'Capela'},
94
+ {state: alagoas, ibge_code: 2702108, name: 'Colônia Leopoldina'},
95
+ {state: alagoas, ibge_code: 2703809, name: 'Joaquim Gomes'},
96
+ {state: alagoas, ibge_code: 2703908, name: 'Jundiá'},
97
+ {state: alagoas, ibge_code: 2705101, name: 'Matriz de Camaragibe'},
98
+ {state: alagoas, ibge_code: 2705507, name: 'Murici'},
99
+ {state: alagoas, ibge_code: 2705606, name: 'Novo Lino'},
100
+ {state: alagoas, ibge_code: 2707305, name: 'Porto Calvo'},
101
+ {state: alagoas, ibge_code: 2703601, name: 'Japaratinga'},
102
+ {state: alagoas, ibge_code: 2704500, name: 'Maragogi'},
103
+ {state: alagoas, ibge_code: 2706505, name: 'Passo de Camaragibe'},
104
+ {state: alagoas, ibge_code: 2707404, name: 'Porto de Pedras'},
105
+ {state: alagoas, ibge_code: 2708709, name: 'São Miguel dos Milagres'}
106
+ ])
107
+
@@ -0,0 +1,20 @@
1
+ amapa = Spree::State.find_by! abbr: 'AP'
2
+
3
+ Spree::City.create!([
4
+ {state: amapa, ibge_code: 1600279, name: "Laranjal do Jari"},
5
+ {state: amapa, ibge_code: 1600154, name: "Pedra Branca do Amapari"},
6
+ {state: amapa, ibge_code: 1600709, name: "Tartarugalzinho"},
7
+ {state: amapa, ibge_code: 1600212, name: "Cutias"},
8
+ {state: amapa, ibge_code: 1600238, name: "Ferreira Gomes"},
9
+ {state: amapa, ibge_code: 1600253, name: "Itaubal"},
10
+ {state: amapa, ibge_code: 1600303, name: "Macapá"},
11
+ {state: amapa, ibge_code: 1600535, name: "Porto Grande"},
12
+ {state: amapa, ibge_code: 1600600, name: "Santana"},
13
+ {state: amapa, ibge_code: 1600402, name: "Mazagão"},
14
+ {state: amapa, ibge_code: 1600808, name: "Vitória do Jari"},
15
+ {state: amapa, ibge_code: 1600501, name: "Oiapoque"},
16
+ {state: amapa, ibge_code: 1600105, name: "Amapá"},
17
+ {state: amapa, ibge_code: 1600550, name: "Pracuúba"},
18
+ {state: amapa, ibge_code: 1600055, name: "Serra do Navio"},
19
+ {state: amapa, ibge_code: 1600204, name: "Calçoene"}
20
+ ])
@@ -0,0 +1,67 @@
1
+ amazonas = Spree::State.find_by! abbr: 'AM'
2
+
3
+ Spree::City.create!([
4
+ {state: amazonas, ibge_code: 1300060, name: "Amaturá"},
5
+ {state: amazonas, ibge_code: 1302702, name: "Manicoré"},
6
+ {state: amazonas, ibge_code: 1303536, name: "Presidente Figueiredo"},
7
+ {state: amazonas, ibge_code: 1302108, name: "Japurá"},
8
+ {state: amazonas, ibge_code: 1300201, name: "Atalaia do Norte"},
9
+ {state: amazonas, ibge_code: 1304062, name: "Tabatinga"},
10
+ {state: amazonas, ibge_code: 1301506, name: "Envira"},
11
+ {state: amazonas, ibge_code: 1302207, name: "Juruá"},
12
+ {state: amazonas, ibge_code: 1304260, name: "Uarini"},
13
+ {state: amazonas, ibge_code: 1300839, name: "Caapiranga"},
14
+ {state: amazonas, ibge_code: 1301100, name: "Careiro"},
15
+ {state: amazonas, ibge_code: 1302553, name: "Manaquiri"},
16
+ {state: amazonas, ibge_code: 1301902, name: "Itacoatiara"},
17
+ {state: amazonas, ibge_code: 1300508, name: "Barreirinha"},
18
+ {state: amazonas, ibge_code: 1303403, name: "Parintins"},
19
+ {state: amazonas, ibge_code: 1300904, name: "Canutama"},
20
+ {state: amazonas, ibge_code: 1300805, name: "Borba"},
21
+ {state: amazonas, ibge_code: 1303304, name: "Novo Aripuanã"},
22
+ {state: amazonas, ibge_code: 1300631, name: "Beruri"},
23
+ {state: amazonas, ibge_code: 1300409, name: "Barcelos"},
24
+ {state: amazonas, ibge_code: 1303205, name: "Novo Airão"},
25
+ {state: amazonas, ibge_code: 1303601, name: "Santa Isabel do Rio Negro"},
26
+ {state: amazonas, ibge_code: 1303809, name: "São Gabriel da Cachoeira"},
27
+ {state: amazonas, ibge_code: 1302801, name: "Maraã"},
28
+ {state: amazonas, ibge_code: 1300607, name: "Benjamin Constant"},
29
+ {state: amazonas, ibge_code: 1301605, name: "Fonte Boa"},
30
+ {state: amazonas, ibge_code: 1302306, name: "Jutaí"},
31
+ {state: amazonas, ibge_code: 1303700, name: "Santo Antônio do Içá"},
32
+ {state: amazonas, ibge_code: 1303908, name: "São Paulo de Olivença"},
33
+ {state: amazonas, ibge_code: 1304237, name: "Tonantins"},
34
+ {state: amazonas, ibge_code: 1301001, name: "Carauari"},
35
+ {state: amazonas, ibge_code: 1301407, name: "Eirunepé"},
36
+ {state: amazonas, ibge_code: 1301654, name: "Guajará"},
37
+ {state: amazonas, ibge_code: 1301803, name: "Ipixuna"},
38
+ {state: amazonas, ibge_code: 1301951, name: "Itamarati"},
39
+ {state: amazonas, ibge_code: 1300029, name: "Alvarães"},
40
+ {state: amazonas, ibge_code: 1300086, name: "Anamã"},
41
+ {state: amazonas, ibge_code: 1300102, name: "Anori"},
42
+ {state: amazonas, ibge_code: 1301209, name: "Coari"},
43
+ {state: amazonas, ibge_code: 1301308, name: "Codajás"},
44
+ {state: amazonas, ibge_code: 1300300, name: "Autazes"},
45
+ {state: amazonas, ibge_code: 1301159, name: "Careiro da Várzea"},
46
+ {state: amazonas, ibge_code: 1301852, name: "Iranduba"},
47
+ {state: amazonas, ibge_code: 1302504, name: "Manacapuru"},
48
+ {state: amazonas, ibge_code: 1302603, name: "Manaus"},
49
+ {state: amazonas, ibge_code: 1303569, name: "Rio Preto da Eva"},
50
+ {state: amazonas, ibge_code: 1302009, name: "Itapiranga"},
51
+ {state: amazonas, ibge_code: 1303106, name: "Nova Olinda do Norte"},
52
+ {state: amazonas, ibge_code: 1304005, name: "Silves"},
53
+ {state: amazonas, ibge_code: 1304401, name: "Urucurituba"},
54
+ {state: amazonas, ibge_code: 1300680, name: "Boa Vista do Ramos"},
55
+ {state: amazonas, ibge_code: 1302900, name: "Maués"},
56
+ {state: amazonas, ibge_code: 1303007, name: "Nhamundá"},
57
+ {state: amazonas, ibge_code: 1303957, name: "São Sebastião do Uatumã"},
58
+ {state: amazonas, ibge_code: 1304302, name: "Urucará"},
59
+ {state: amazonas, ibge_code: 1300706, name: "Boca do Acre"},
60
+ {state: amazonas, ibge_code: 1303502, name: "Pauini"},
61
+ {state: amazonas, ibge_code: 1302405, name: "Lábrea"},
62
+ {state: amazonas, ibge_code: 1304104, name: "Tapauá"},
63
+ {state: amazonas, ibge_code: 1300144, name: "Apuí"},
64
+ {state: amazonas, ibge_code: 1301704, name: "Humaitá"},
65
+ {state: amazonas, ibge_code: 1304203, name: "Tefé"}
66
+ ])
67
+