spree_counties 1.0.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.
- checksums.yaml +7 -0
- data/.bundle/config +2 -0
- data/.gitignore +14 -0
- data/.rspec +1 -0
- data/Gemfile +7 -0
- data/LICENSE.txt +22 -0
- data/README.md +43 -0
- data/Rakefile +21 -0
- data/app/assets/javascripts/spree/backend/spree_counties.js +30 -0
- data/app/assets/javascripts/spree/frontend/spree_counties.js.coffee +58 -0
- data/app/assets/stylesheets/spree/backend/spree_counties.css +4 -0
- data/app/assets/stylesheets/spree/frontend/spree_counties.css +4 -0
- data/app/controllers/spree/api/counties_controller.rb +38 -0
- data/app/models/county_ability.rb +10 -0
- data/app/models/spree/address_decorator.rb +7 -0
- data/app/models/spree/county.rb +13 -0
- data/app/models/spree/state_decorator.rb +3 -0
- data/app/views/spree/address/_form.html.erb +86 -0
- data/app/views/spree/admin/shared/_address_form.html.erb +81 -0
- data/app/views/spree/api/counties/index.v1.rabl +11 -0
- data/app/views/spree/api/counties/show.v1.rabl +2 -0
- data/bin/rails +7 -0
- data/config/locales/en.yml +5 -0
- data/config/routes.rb +6 -0
- data/db/migrate/20140729200830_create_spree_counties.rb +10 -0
- data/db/migrate/20140729203900_add_spree_county_reference_to_spree_address.rb +5 -0
- data/db/migrate/20141119225426_add_county_name_to_spree_address.rb +5 -0
- data/lib/generators/spree_counties/install/install_generator.rb +41 -0
- data/lib/generators/spree_counties/install/templates/1.png +0 -0
- data/lib/generators/spree_counties/install/templates/2.png +0 -0
- data/lib/generators/spree_counties/install/templates/seeds/counties.rb +367 -0
- data/lib/spree_counties/engine.rb +20 -0
- data/lib/spree_counties/factories.rb +6 -0
- data/lib/spree_counties/version.rb +3 -0
- data/lib/spree_counties.rb +2 -0
- data/spec/spec_helper.rb +87 -0
- data/spree_counties.gemspec +32 -0
- metadata +235 -0
@@ -0,0 +1,367 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
country = Spree::Country.find_or_create_by name:'Chile', iso_name: "CHILE", iso: "CL", iso3: "CHL", numcode: 152, states_required: false
|
4
|
+
|
5
|
+
#Chilean states
|
6
|
+
xi = Spree::State.find_or_create_by name: 'Aysén del General Carlos Ibanez', abbr: 'AI', country: country
|
7
|
+
ii = Spree::State.find_or_create_by name: 'Antofagasta', abbr: 'AN', country: country
|
8
|
+
ix = Spree::State.find_or_create_by name: 'Araucanía', abbr: 'AR', country: country
|
9
|
+
xv = Spree::State.find_or_create_by name: 'Arica y Parinacota', abbr: 'AP', country: country
|
10
|
+
iii = Spree::State.find_or_create_by name: 'Atacama', abbr: 'AT', country: country
|
11
|
+
viii = Spree::State.find_or_create_by name: 'Bio-Bío', abbr: 'BI', country: country
|
12
|
+
iv = Spree::State.find_or_create_by name: 'Coquimbo', abbr: 'CO', country: country
|
13
|
+
vi = Spree::State.find_or_create_by name: 'Libertador General Bernardo O\'Higgins', abbr: 'LI', country: country
|
14
|
+
x = Spree::State.find_or_create_by name: 'Los Lagos', abbr: 'LL', country: country
|
15
|
+
xii = Spree::State.find_or_create_by name: 'Magallanes y de la Antártica Chilena', abbr: 'MA', country: country
|
16
|
+
vii = Spree::State.find_or_create_by name: 'Maule', abbr: 'ML', country: country
|
17
|
+
rm = Spree::State.find_or_create_by name: 'Metropolitana', abbr: 'RM', country: country
|
18
|
+
xiv = Spree::State.find_or_create_by name: 'Los Ríos', abbr: 'LR', country: country
|
19
|
+
i = Spree::State.find_or_create_by name: 'Tarapacá', abbr: 'TA', country: country
|
20
|
+
v = Spree::State.find_or_create_by name: 'Valparaíso', abbr: 'VS', country: country
|
21
|
+
|
22
|
+
Spree::County.find_or_create_by(name: 'Arica', state: xv)
|
23
|
+
Spree::County.find_or_create_by(name: 'Camarones', state: xv)
|
24
|
+
Spree::County.find_or_create_by(name: 'Putre', state: xv)
|
25
|
+
Spree::County.find_or_create_by(name: 'General Lagos', state: xv)
|
26
|
+
Spree::County.find_or_create_by(name: 'Iquique', state: i)
|
27
|
+
Spree::County.find_or_create_by(name: 'Alto Hospicio', state: i)
|
28
|
+
Spree::County.find_or_create_by(name: 'Pozo Almonte', state: i)
|
29
|
+
Spree::County.find_or_create_by(name: 'Camiña', state: i)
|
30
|
+
Spree::County.find_or_create_by(name: 'Colchane', state: i)
|
31
|
+
Spree::County.find_or_create_by(name: 'Huara', state: i)
|
32
|
+
Spree::County.find_or_create_by(name: 'Pica', state: i)
|
33
|
+
Spree::County.find_or_create_by(name: 'Antofagasta', state: ii)
|
34
|
+
Spree::County.find_or_create_by(name: 'Mejillones', state: ii)
|
35
|
+
Spree::County.find_or_create_by(name: 'Sierra Gorda', state: ii)
|
36
|
+
Spree::County.find_or_create_by(name: 'Taltal', state: ii)
|
37
|
+
Spree::County.find_or_create_by(name: 'Calama', state: ii)
|
38
|
+
Spree::County.find_or_create_by(name: 'Ollagüe', state: ii)
|
39
|
+
Spree::County.find_or_create_by(name: 'San Pedro de Atacama', state: ii)
|
40
|
+
Spree::County.find_or_create_by(name: 'Tocopilla', state: ii)
|
41
|
+
Spree::County.find_or_create_by(name: 'María Elena', state: ii)
|
42
|
+
Spree::County.find_or_create_by(name: 'Copiapó', state: iii)
|
43
|
+
Spree::County.find_or_create_by(name: 'Caldera', state: iii)
|
44
|
+
Spree::County.find_or_create_by(name: 'Tierra Amarilla', state: iii)
|
45
|
+
Spree::County.find_or_create_by(name: 'Chañaral', state: iii)
|
46
|
+
Spree::County.find_or_create_by(name: 'Diego de Almagro', state: iii)
|
47
|
+
Spree::County.find_or_create_by(name: 'Vallenar', state: iii)
|
48
|
+
Spree::County.find_or_create_by(name: 'Alto del Carmen', state: iii)
|
49
|
+
Spree::County.find_or_create_by(name: 'Freirina', state: iii)
|
50
|
+
Spree::County.find_or_create_by(name: 'Huasco', state: iii)
|
51
|
+
Spree::County.find_or_create_by(name: 'La Serena', state: iv)
|
52
|
+
Spree::County.find_or_create_by(name: 'Coquimbo', state: iv)
|
53
|
+
Spree::County.find_or_create_by(name: 'Andacollo', state: iv)
|
54
|
+
Spree::County.find_or_create_by(name: 'La Higuera', state: iv)
|
55
|
+
Spree::County.find_or_create_by(name: 'Paiguano', state: iv)
|
56
|
+
Spree::County.find_or_create_by(name: 'Vicuña', state: iv)
|
57
|
+
Spree::County.find_or_create_by(name: 'Illapel', state: iv)
|
58
|
+
Spree::County.find_or_create_by(name: 'Canela', state: iv)
|
59
|
+
Spree::County.find_or_create_by(name: 'Los Vilos', state: iv)
|
60
|
+
Spree::County.find_or_create_by(name: 'Salamanca', state: iv)
|
61
|
+
Spree::County.find_or_create_by(name: 'Ovalle', state: iv)
|
62
|
+
Spree::County.find_or_create_by(name: 'Combarbalá', state: iv)
|
63
|
+
Spree::County.find_or_create_by(name: 'Monte Patria', state: iv)
|
64
|
+
Spree::County.find_or_create_by(name: 'Punitaqui', state: iv)
|
65
|
+
Spree::County.find_or_create_by(name: 'Río Hurtado', state: iv)
|
66
|
+
Spree::County.find_or_create_by(name: 'Valparaíso', state: v)
|
67
|
+
Spree::County.find_or_create_by(name: 'Casablanca', state: v)
|
68
|
+
Spree::County.find_or_create_by(name: 'Concón', state: v)
|
69
|
+
Spree::County.find_or_create_by(name: 'Juan Fernández', state: v)
|
70
|
+
Spree::County.find_or_create_by(name: 'Puchuncaví', state: v)
|
71
|
+
Spree::County.find_or_create_by(name: 'Quintero', state: v)
|
72
|
+
Spree::County.find_or_create_by(name: 'Viña del Mar', state: v)
|
73
|
+
Spree::County.find_or_create_by(name: 'Isla de Pascua', state: v)
|
74
|
+
Spree::County.find_or_create_by(name: 'Los Andes', state: v)
|
75
|
+
Spree::County.find_or_create_by(name: 'Calle Larga', state: v)
|
76
|
+
Spree::County.find_or_create_by(name: 'Rinconada', state: v)
|
77
|
+
Spree::County.find_or_create_by(name: 'San Esteban', state: v)
|
78
|
+
Spree::County.find_or_create_by(name: 'La Ligua', state: v)
|
79
|
+
Spree::County.find_or_create_by(name: 'Cabildo', state: v)
|
80
|
+
Spree::County.find_or_create_by(name: 'Papudo', state: v)
|
81
|
+
Spree::County.find_or_create_by(name: 'Petorca', state: v)
|
82
|
+
Spree::County.find_or_create_by(name: 'Zapallar', state: v)
|
83
|
+
Spree::County.find_or_create_by(name: 'Quillota', state: v)
|
84
|
+
Spree::County.find_or_create_by(name: 'Calera', state: v)
|
85
|
+
Spree::County.find_or_create_by(name: 'Hijuelas', state: v)
|
86
|
+
Spree::County.find_or_create_by(name: 'La Cruz', state: v)
|
87
|
+
Spree::County.find_or_create_by(name: 'Nogales', state: v)
|
88
|
+
Spree::County.find_or_create_by(name: 'San Antonio', state: v)
|
89
|
+
Spree::County.find_or_create_by(name: 'Algarrobo', state: v)
|
90
|
+
Spree::County.find_or_create_by(name: 'Cartagena', state: v)
|
91
|
+
Spree::County.find_or_create_by(name: 'El Quisco', state: v)
|
92
|
+
Spree::County.find_or_create_by(name: 'El Tabo', state: v)
|
93
|
+
Spree::County.find_or_create_by(name: 'Santo Domingo', state: v)
|
94
|
+
Spree::County.find_or_create_by(name: 'San Felipe', state: v)
|
95
|
+
Spree::County.find_or_create_by(name: 'Catemu', state: v)
|
96
|
+
Spree::County.find_or_create_by(name: 'Llaillay', state: v)
|
97
|
+
Spree::County.find_or_create_by(name: 'Panquehue', state: v)
|
98
|
+
Spree::County.find_or_create_by(name: 'Putaendo', state: v)
|
99
|
+
Spree::County.find_or_create_by(name: 'Santa María', state: v)
|
100
|
+
Spree::County.find_or_create_by(name: 'Limache', state: v)
|
101
|
+
Spree::County.find_or_create_by(name: 'Quilpué', state: v)
|
102
|
+
Spree::County.find_or_create_by(name: 'Villa Alemana', state: v)
|
103
|
+
Spree::County.find_or_create_by(name: 'Olmué', state: v)
|
104
|
+
Spree::County.find_or_create_by(name: 'Rancagua', state: vi)
|
105
|
+
Spree::County.find_or_create_by(name: 'Codegua', state: vi)
|
106
|
+
Spree::County.find_or_create_by(name: 'Coinco', state: vi)
|
107
|
+
Spree::County.find_or_create_by(name: 'Coltauco', state: vi)
|
108
|
+
Spree::County.find_or_create_by(name: 'Doñihue', state: vi)
|
109
|
+
Spree::County.find_or_create_by(name: 'Graneros', state: vi)
|
110
|
+
Spree::County.find_or_create_by(name: 'Las Cabras', state: vi)
|
111
|
+
Spree::County.find_or_create_by(name: 'Machalí', state: vi)
|
112
|
+
Spree::County.find_or_create_by(name: 'Malloa', state: vi)
|
113
|
+
Spree::County.find_or_create_by(name: 'Mostazal', state: vi)
|
114
|
+
Spree::County.find_or_create_by(name: 'Olivar', state: vi)
|
115
|
+
Spree::County.find_or_create_by(name: 'Peumo', state: vi)
|
116
|
+
Spree::County.find_or_create_by(name: 'Pichidegua', state: vi)
|
117
|
+
Spree::County.find_or_create_by(name: 'Quinta de Tilcoco', state: vi)
|
118
|
+
Spree::County.find_or_create_by(name: 'Rengo', state: vi)
|
119
|
+
Spree::County.find_or_create_by(name: 'Requínoa', state: vi)
|
120
|
+
Spree::County.find_or_create_by(name: 'San Vicente', state: vi)
|
121
|
+
Spree::County.find_or_create_by(name: 'Pichilemu', state: vi)
|
122
|
+
Spree::County.find_or_create_by(name: 'La Estrella', state: vi)
|
123
|
+
Spree::County.find_or_create_by(name: 'Litueche', state: vi)
|
124
|
+
Spree::County.find_or_create_by(name: 'Marchihue', state: vi)
|
125
|
+
Spree::County.find_or_create_by(name: 'Navidad', state: vi)
|
126
|
+
Spree::County.find_or_create_by(name: 'Paredones', state: vi)
|
127
|
+
Spree::County.find_or_create_by(name: 'San Fernando', state: vi)
|
128
|
+
Spree::County.find_or_create_by(name: 'Chépica', state: vi)
|
129
|
+
Spree::County.find_or_create_by(name: 'Chimbarongo', state: vi)
|
130
|
+
Spree::County.find_or_create_by(name: 'Lolol', state: vi)
|
131
|
+
Spree::County.find_or_create_by(name: 'Nancagua', state: vi)
|
132
|
+
Spree::County.find_or_create_by(name: 'Palmilla', state: vi)
|
133
|
+
Spree::County.find_or_create_by(name: 'Peralillo', state: vi)
|
134
|
+
Spree::County.find_or_create_by(name: 'Placilla', state: vi)
|
135
|
+
Spree::County.find_or_create_by(name: 'Pumanque', state: vi)
|
136
|
+
Spree::County.find_or_create_by(name: 'Santa Cruz', state: vi)
|
137
|
+
Spree::County.find_or_create_by(name: 'Talca', state: vii)
|
138
|
+
Spree::County.find_or_create_by(name: 'Constitución', state: vii)
|
139
|
+
Spree::County.find_or_create_by(name: 'Curepto', state: vii)
|
140
|
+
Spree::County.find_or_create_by(name: 'Empedrado', state: vii)
|
141
|
+
Spree::County.find_or_create_by(name: 'Maule', state: vii)
|
142
|
+
Spree::County.find_or_create_by(name: 'Pelarco', state: vii)
|
143
|
+
Spree::County.find_or_create_by(name: 'Pencahue', state: vii)
|
144
|
+
Spree::County.find_or_create_by(name: 'Río Claro', state: vii)
|
145
|
+
Spree::County.find_or_create_by(name: 'San Clemente', state: vii)
|
146
|
+
Spree::County.find_or_create_by(name: 'San Rafael', state: vii)
|
147
|
+
Spree::County.find_or_create_by(name: 'Cauquenes', state: vii)
|
148
|
+
Spree::County.find_or_create_by(name: 'Chanco', state: vii)
|
149
|
+
Spree::County.find_or_create_by(name: 'Pelluhue', state: vii)
|
150
|
+
Spree::County.find_or_create_by(name: 'Curicó', state: vii)
|
151
|
+
Spree::County.find_or_create_by(name: 'Hualañé', state: vii)
|
152
|
+
Spree::County.find_or_create_by(name: 'Licantén', state: vii)
|
153
|
+
Spree::County.find_or_create_by(name: 'Molina', state: vii)
|
154
|
+
Spree::County.find_or_create_by(name: 'Rauco', state: vii)
|
155
|
+
Spree::County.find_or_create_by(name: 'Romeral', state: vii)
|
156
|
+
Spree::County.find_or_create_by(name: 'Sagrada Familia', state: vii)
|
157
|
+
Spree::County.find_or_create_by(name: 'Teno', state: vii)
|
158
|
+
Spree::County.find_or_create_by(name: 'Vichuquén', state: vii)
|
159
|
+
Spree::County.find_or_create_by(name: 'Linares', state: vii)
|
160
|
+
Spree::County.find_or_create_by(name: 'Colbún', state: vii)
|
161
|
+
Spree::County.find_or_create_by(name: 'Longaví', state: vii)
|
162
|
+
Spree::County.find_or_create_by(name: 'Parral', state: vii)
|
163
|
+
Spree::County.find_or_create_by(name: 'Retiro', state: vii)
|
164
|
+
Spree::County.find_or_create_by(name: 'San Javier', state: vii)
|
165
|
+
Spree::County.find_or_create_by(name: 'Villa Alegre', state: vii)
|
166
|
+
Spree::County.find_or_create_by(name: 'Yerbas Buenas', state: vii)
|
167
|
+
Spree::County.find_or_create_by(name: 'Concepción', state: viii)
|
168
|
+
Spree::County.find_or_create_by(name: 'Coronel', state: viii)
|
169
|
+
Spree::County.find_or_create_by(name: 'Chiguayante', state: viii)
|
170
|
+
Spree::County.find_or_create_by(name: 'Florida', state: viii)
|
171
|
+
Spree::County.find_or_create_by(name: 'Hualqui', state: viii)
|
172
|
+
Spree::County.find_or_create_by(name: 'Lota', state: viii)
|
173
|
+
Spree::County.find_or_create_by(name: 'Penco', state: viii)
|
174
|
+
Spree::County.find_or_create_by(name: 'San Pedro de la Paz', state: viii)
|
175
|
+
Spree::County.find_or_create_by(name: 'Santa Juana', state: viii)
|
176
|
+
Spree::County.find_or_create_by(name: 'Talcahuano', state: viii)
|
177
|
+
Spree::County.find_or_create_by(name: 'Tomé', state: viii)
|
178
|
+
Spree::County.find_or_create_by(name: 'Hualpén', state: viii)
|
179
|
+
Spree::County.find_or_create_by(name: 'Lebu', state: viii)
|
180
|
+
Spree::County.find_or_create_by(name: 'Arauco', state: viii)
|
181
|
+
Spree::County.find_or_create_by(name: 'Cañete', state: viii)
|
182
|
+
Spree::County.find_or_create_by(name: 'Contulmo', state: viii)
|
183
|
+
Spree::County.find_or_create_by(name: 'Curanilahue', state: viii)
|
184
|
+
Spree::County.find_or_create_by(name: 'Los Alamos', state: viii)
|
185
|
+
Spree::County.find_or_create_by(name: 'Tirúa', state: viii)
|
186
|
+
Spree::County.find_or_create_by(name: 'Los Angeles', state: viii)
|
187
|
+
Spree::County.find_or_create_by(name: 'Antuco', state: viii)
|
188
|
+
Spree::County.find_or_create_by(name: 'Cabrero', state: viii)
|
189
|
+
Spree::County.find_or_create_by(name: 'Laja', state: viii)
|
190
|
+
Spree::County.find_or_create_by(name: 'Mulchén', state: viii)
|
191
|
+
Spree::County.find_or_create_by(name: 'Nacimiento', state: viii)
|
192
|
+
Spree::County.find_or_create_by(name: 'Negrete', state: viii)
|
193
|
+
Spree::County.find_or_create_by(name: 'Quilaco', state: viii)
|
194
|
+
Spree::County.find_or_create_by(name: 'Quilleco', state: viii)
|
195
|
+
Spree::County.find_or_create_by(name: 'San Rosendo', state: viii)
|
196
|
+
Spree::County.find_or_create_by(name: 'Santa Bárbara', state: viii)
|
197
|
+
Spree::County.find_or_create_by(name: 'Tucapel', state: viii)
|
198
|
+
Spree::County.find_or_create_by(name: 'Yumbel', state: viii)
|
199
|
+
Spree::County.find_or_create_by(name: 'Alto Biobío', state: viii)
|
200
|
+
Spree::County.find_or_create_by(name: 'Chillán', state: viii)
|
201
|
+
Spree::County.find_or_create_by(name: 'Bulnes', state: viii)
|
202
|
+
Spree::County.find_or_create_by(name: 'Cobquecura', state: viii)
|
203
|
+
Spree::County.find_or_create_by(name: 'Coelemu', state: viii)
|
204
|
+
Spree::County.find_or_create_by(name: 'Coihueco', state: viii)
|
205
|
+
Spree::County.find_or_create_by(name: 'Chillán Viejo', state: viii)
|
206
|
+
Spree::County.find_or_create_by(name: 'El Carmen', state: viii)
|
207
|
+
Spree::County.find_or_create_by(name: 'Ninhue', state: viii)
|
208
|
+
Spree::County.find_or_create_by(name: 'Ñiquén', state: viii)
|
209
|
+
Spree::County.find_or_create_by(name: 'Pemuco', state: viii)
|
210
|
+
Spree::County.find_or_create_by(name: 'Pinto', state: viii)
|
211
|
+
Spree::County.find_or_create_by(name: 'Portezuelo', state: viii)
|
212
|
+
Spree::County.find_or_create_by(name: 'Quillón', state: viii)
|
213
|
+
Spree::County.find_or_create_by(name: 'Quirihue', state: viii)
|
214
|
+
Spree::County.find_or_create_by(name: 'Ránquil', state: viii)
|
215
|
+
Spree::County.find_or_create_by(name: 'San Carlos', state: viii)
|
216
|
+
Spree::County.find_or_create_by(name: 'San Fabián', state: viii)
|
217
|
+
Spree::County.find_or_create_by(name: 'San Ignacio', state: viii)
|
218
|
+
Spree::County.find_or_create_by(name: 'San Nicolás', state: viii)
|
219
|
+
Spree::County.find_or_create_by(name: 'Treguaco', state: viii)
|
220
|
+
Spree::County.find_or_create_by(name: 'Yungay', state: viii)
|
221
|
+
Spree::County.find_or_create_by(name: 'Temuco', state: ix)
|
222
|
+
Spree::County.find_or_create_by(name: 'Carahue', state: ix)
|
223
|
+
Spree::County.find_or_create_by(name: 'Cunco', state: ix)
|
224
|
+
Spree::County.find_or_create_by(name: 'Curarrehue', state: ix)
|
225
|
+
Spree::County.find_or_create_by(name: 'Freire', state: ix)
|
226
|
+
Spree::County.find_or_create_by(name: 'Galvarino', state: ix)
|
227
|
+
Spree::County.find_or_create_by(name: 'Gorbea', state: ix)
|
228
|
+
Spree::County.find_or_create_by(name: 'Lautaro', state: ix)
|
229
|
+
Spree::County.find_or_create_by(name: 'Loncoche', state: ix)
|
230
|
+
Spree::County.find_or_create_by(name: 'Melipeuco', state: ix)
|
231
|
+
Spree::County.find_or_create_by(name: 'Nueva Imperial', state: ix)
|
232
|
+
Spree::County.find_or_create_by(name: 'Padre Las Casas', state: ix)
|
233
|
+
Spree::County.find_or_create_by(name: 'Perquenco', state: ix)
|
234
|
+
Spree::County.find_or_create_by(name: 'Pitrufquén', state: ix)
|
235
|
+
Spree::County.find_or_create_by(name: 'Pucón', state: ix)
|
236
|
+
Spree::County.find_or_create_by(name: 'Saavedra', state: ix)
|
237
|
+
Spree::County.find_or_create_by(name: 'Teodoro Schmidt', state: ix)
|
238
|
+
Spree::County.find_or_create_by(name: 'Toltén', state: ix)
|
239
|
+
Spree::County.find_or_create_by(name: 'Vilcún', state: ix)
|
240
|
+
Spree::County.find_or_create_by(name: 'Villarrica', state: ix)
|
241
|
+
Spree::County.find_or_create_by(name: 'Cholchol', state: ix)
|
242
|
+
Spree::County.find_or_create_by(name: 'Angol', state: ix)
|
243
|
+
Spree::County.find_or_create_by(name: 'Collipulli', state: ix)
|
244
|
+
Spree::County.find_or_create_by(name: 'Curacautín', state: ix)
|
245
|
+
Spree::County.find_or_create_by(name: 'Ercilla', state: ix)
|
246
|
+
Spree::County.find_or_create_by(name: 'Lonquimay', state: ix)
|
247
|
+
Spree::County.find_or_create_by(name: 'Los Sauces', state: ix)
|
248
|
+
Spree::County.find_or_create_by(name: 'Lumaco', state: ix)
|
249
|
+
Spree::County.find_or_create_by(name: 'Purén', state: ix)
|
250
|
+
Spree::County.find_or_create_by(name: 'Renaico', state: ix)
|
251
|
+
Spree::County.find_or_create_by(name: 'Traiguén', state: ix)
|
252
|
+
Spree::County.find_or_create_by(name: 'Victoria', state: ix)
|
253
|
+
Spree::County.find_or_create_by(name: 'Valdivia', state: xiv)
|
254
|
+
Spree::County.find_or_create_by(name: 'Corral', state: xiv)
|
255
|
+
Spree::County.find_or_create_by(name: 'Lanco', state: xiv)
|
256
|
+
Spree::County.find_or_create_by(name: 'Los Lagos', state: xiv)
|
257
|
+
Spree::County.find_or_create_by(name: 'Máfil', state: xiv)
|
258
|
+
Spree::County.find_or_create_by(name: 'Mariquina', state: xiv)
|
259
|
+
Spree::County.find_or_create_by(name: 'Paillaco', state: xiv)
|
260
|
+
Spree::County.find_or_create_by(name: 'Panguipulli', state: xiv)
|
261
|
+
Spree::County.find_or_create_by(name: 'La Unión', state: xiv)
|
262
|
+
Spree::County.find_or_create_by(name: 'Futrono', state: xiv)
|
263
|
+
Spree::County.find_or_create_by(name: 'Lago Ranco', state: xiv)
|
264
|
+
Spree::County.find_or_create_by(name: 'Río Bueno', state: xiv)
|
265
|
+
Spree::County.find_or_create_by(name: 'Puerto Montt', state: x)
|
266
|
+
Spree::County.find_or_create_by(name: 'Calbuco', state: x)
|
267
|
+
Spree::County.find_or_create_by(name: 'Cochamó', state: x)
|
268
|
+
Spree::County.find_or_create_by(name: 'Fresia', state: x)
|
269
|
+
Spree::County.find_or_create_by(name: 'Frutillar', state: x)
|
270
|
+
Spree::County.find_or_create_by(name: 'Los Muermos', state: x)
|
271
|
+
Spree::County.find_or_create_by(name: 'Llanquihue', state: x)
|
272
|
+
Spree::County.find_or_create_by(name: 'Maullín', state: x)
|
273
|
+
Spree::County.find_or_create_by(name: 'Puerto Varas', state: x)
|
274
|
+
Spree::County.find_or_create_by(name: 'Castro', state: x)
|
275
|
+
Spree::County.find_or_create_by(name: 'Ancud', state: x)
|
276
|
+
Spree::County.find_or_create_by(name: 'Chonchi', state: x)
|
277
|
+
Spree::County.find_or_create_by(name: 'Curaco de Vélez', state: x)
|
278
|
+
Spree::County.find_or_create_by(name: 'Dalcahue', state: x)
|
279
|
+
Spree::County.find_or_create_by(name: 'Puqueldón', state: x)
|
280
|
+
Spree::County.find_or_create_by(name: 'Queilén', state: x)
|
281
|
+
Spree::County.find_or_create_by(name: 'Quellón', state: x)
|
282
|
+
Spree::County.find_or_create_by(name: 'Quemchi', state: x)
|
283
|
+
Spree::County.find_or_create_by(name: 'Quinchao', state: x)
|
284
|
+
Spree::County.find_or_create_by(name: 'Osorno', state: x)
|
285
|
+
Spree::County.find_or_create_by(name: 'Puerto Octay', state: x)
|
286
|
+
Spree::County.find_or_create_by(name: 'Purranque', state: x)
|
287
|
+
Spree::County.find_or_create_by(name: 'Puyehue', state: x)
|
288
|
+
Spree::County.find_or_create_by(name: 'Río Negro', state: x)
|
289
|
+
Spree::County.find_or_create_by(name: 'San Juan de la Costa', state: x)
|
290
|
+
Spree::County.find_or_create_by(name: 'San Pablo', state: x)
|
291
|
+
Spree::County.find_or_create_by(name: 'Chaitén', state: x)
|
292
|
+
Spree::County.find_or_create_by(name: 'Futaleufú', state: x)
|
293
|
+
Spree::County.find_or_create_by(name: 'Hualaihué', state: x)
|
294
|
+
Spree::County.find_or_create_by(name: 'Palena', state: x)
|
295
|
+
Spree::County.find_or_create_by(name: 'Coihaique', state: xi)
|
296
|
+
Spree::County.find_or_create_by(name: 'Lago Verde', state: xi)
|
297
|
+
Spree::County.find_or_create_by(name: 'Aisén', state: xi)
|
298
|
+
Spree::County.find_or_create_by(name: 'Cisnes', state: xi)
|
299
|
+
Spree::County.find_or_create_by(name: 'Guaitecas', state: xi)
|
300
|
+
Spree::County.find_or_create_by(name: 'Cochrane', state: xi)
|
301
|
+
Spree::County.find_or_create_by(name: 'O\'Higgins', state: xi)
|
302
|
+
Spree::County.find_or_create_by(name: 'Tortel', state: xi)
|
303
|
+
Spree::County.find_or_create_by(name: 'Chile Chico', state: xi)
|
304
|
+
Spree::County.find_or_create_by(name: 'Río Ibáñez', state: xi)
|
305
|
+
Spree::County.find_or_create_by(name: 'Punta Arenas', state: xii)
|
306
|
+
Spree::County.find_or_create_by(name: 'Laguna Blanca', state: xii)
|
307
|
+
Spree::County.find_or_create_by(name: 'Río Verde', state: xii)
|
308
|
+
Spree::County.find_or_create_by(name: 'San Gregorio', state: xii)
|
309
|
+
Spree::County.find_or_create_by(name: 'Cabo de Hornos', state: xii)
|
310
|
+
Spree::County.find_or_create_by(name: 'Antártica', state: xii)
|
311
|
+
Spree::County.find_or_create_by(name: 'Porvenir', state: xii)
|
312
|
+
Spree::County.find_or_create_by(name: 'Primavera', state: xii)
|
313
|
+
Spree::County.find_or_create_by(name: 'Timaukel', state: xii)
|
314
|
+
Spree::County.find_or_create_by(name: 'Natales', state: xii)
|
315
|
+
Spree::County.find_or_create_by(name: 'Torres del Paine', state: xii)
|
316
|
+
Spree::County.find_or_create_by(name: 'Colina', state: rm)
|
317
|
+
Spree::County.find_or_create_by(name: 'Lampa', state: rm)
|
318
|
+
Spree::County.find_or_create_by(name: 'Tiltil', state: rm)
|
319
|
+
Spree::County.find_or_create_by(name: 'Pirque', state: rm)
|
320
|
+
Spree::County.find_or_create_by(name: 'Puente Alto', state: rm)
|
321
|
+
Spree::County.find_or_create_by(name: 'San José de Maipo', state: rm)
|
322
|
+
Spree::County.find_or_create_by(name: 'Buin', state: rm)
|
323
|
+
Spree::County.find_or_create_by(name: 'Calera de Tango', state: rm)
|
324
|
+
Spree::County.find_or_create_by(name: 'Paine', state: rm)
|
325
|
+
Spree::County.find_or_create_by(name: 'San Bernardo', state: rm)
|
326
|
+
Spree::County.find_or_create_by(name: 'Alhué', state: rm)
|
327
|
+
Spree::County.find_or_create_by(name: 'Curacaví', state: rm)
|
328
|
+
Spree::County.find_or_create_by(name: 'María Pinto', state: rm)
|
329
|
+
Spree::County.find_or_create_by(name: 'Melipilla', state: rm)
|
330
|
+
Spree::County.find_or_create_by(name: 'San Pedro', state: rm)
|
331
|
+
Spree::County.find_or_create_by(name: 'Cerrillos', state: rm)
|
332
|
+
Spree::County.find_or_create_by(name: 'Cerro Navia', state: rm)
|
333
|
+
Spree::County.find_or_create_by(name: 'Conchalí', state: rm)
|
334
|
+
Spree::County.find_or_create_by(name: 'El Bosque', state: rm)
|
335
|
+
Spree::County.find_or_create_by(name: 'Estación Central', state: rm)
|
336
|
+
Spree::County.find_or_create_by(name: 'Huechuraba', state: rm)
|
337
|
+
Spree::County.find_or_create_by(name: 'Independencia', state: rm)
|
338
|
+
Spree::County.find_or_create_by(name: 'La Cisterna', state: rm)
|
339
|
+
Spree::County.find_or_create_by(name: 'La Granja', state: rm)
|
340
|
+
Spree::County.find_or_create_by(name: 'La Florida', state: rm)
|
341
|
+
Spree::County.find_or_create_by(name: 'La Pintana', state: rm)
|
342
|
+
Spree::County.find_or_create_by(name: 'La Reina', state: rm)
|
343
|
+
Spree::County.find_or_create_by(name: 'Las Condes', state: rm)
|
344
|
+
Spree::County.find_or_create_by(name: 'Lo Barnechea', state: rm)
|
345
|
+
Spree::County.find_or_create_by(name: 'Lo Espejo', state: rm)
|
346
|
+
Spree::County.find_or_create_by(name: 'Lo Prado', state: rm)
|
347
|
+
Spree::County.find_or_create_by(name: 'Macul', state: rm)
|
348
|
+
Spree::County.find_or_create_by(name: 'Maipú', state: rm)
|
349
|
+
Spree::County.find_or_create_by(name: 'Ñuñoa', state: rm)
|
350
|
+
Spree::County.find_or_create_by(name: 'Pedro Aguirre Cerda', state: rm)
|
351
|
+
Spree::County.find_or_create_by(name: 'Peñalolén', state: rm)
|
352
|
+
Spree::County.find_or_create_by(name: 'Providencia', state: rm)
|
353
|
+
Spree::County.find_or_create_by(name: 'Pudahuel', state: rm)
|
354
|
+
Spree::County.find_or_create_by(name: 'Quilicura', state: rm)
|
355
|
+
Spree::County.find_or_create_by(name: 'Quinta Normal', state: rm)
|
356
|
+
Spree::County.find_or_create_by(name: 'Recoleta', state: rm)
|
357
|
+
Spree::County.find_or_create_by(name: 'Renca', state: rm)
|
358
|
+
Spree::County.find_or_create_by(name: 'San Miguel', state: rm)
|
359
|
+
Spree::County.find_or_create_by(name: 'San Joaquín', state: rm)
|
360
|
+
Spree::County.find_or_create_by(name: 'San Ramón', state: rm)
|
361
|
+
Spree::County.find_or_create_by(name: 'Santiago', state: rm)
|
362
|
+
Spree::County.find_or_create_by(name: 'Vitacura', state: rm)
|
363
|
+
Spree::County.find_or_create_by(name: 'El Monte', state: rm)
|
364
|
+
Spree::County.find_or_create_by(name: 'Isla de Maipo', state: rm)
|
365
|
+
Spree::County.find_or_create_by(name: 'Padre Hurtado', state: rm)
|
366
|
+
Spree::County.find_or_create_by(name: 'Peñaflor', state: rm)
|
367
|
+
Spree::County.find_or_create_by(name: 'Talagante', state: rm)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module SpreeCounties
|
2
|
+
class Engine < Rails::Engine
|
3
|
+
require 'spree/core'
|
4
|
+
isolate_namespace Spree
|
5
|
+
engine_name 'spree_counties'
|
6
|
+
|
7
|
+
# use rspec for tests
|
8
|
+
config.generators do |g|
|
9
|
+
g.test_framework :rspec
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.activate
|
13
|
+
Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
|
14
|
+
Rails.configuration.cache_classes ? require(c) : load(c)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
config.to_prepare &method(:activate).to_proc
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
FactoryGirl.define do
|
2
|
+
# Define your Spree extensions Factories within this file to enable applications, and other extensions to use and override them.
|
3
|
+
#
|
4
|
+
# Example adding this to your spec_helper will load these Factories for use:
|
5
|
+
# require 'spree_counties/factories'
|
6
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
# Run Coverage report
|
2
|
+
require 'simplecov'
|
3
|
+
SimpleCov.start do
|
4
|
+
add_filter 'spec/dummy'
|
5
|
+
add_group 'Controllers', 'app/controllers'
|
6
|
+
add_group 'Helpers', 'app/helpers'
|
7
|
+
add_group 'Mailers', 'app/mailers'
|
8
|
+
add_group 'Models', 'app/models'
|
9
|
+
add_group 'Views', 'app/views'
|
10
|
+
add_group 'Libraries', 'lib'
|
11
|
+
end
|
12
|
+
|
13
|
+
# Configure Rails Environment
|
14
|
+
ENV['RAILS_ENV'] = 'test'
|
15
|
+
|
16
|
+
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
17
|
+
|
18
|
+
require 'rspec/rails'
|
19
|
+
require 'database_cleaner'
|
20
|
+
require 'ffaker'
|
21
|
+
|
22
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
23
|
+
# in spec/support/ and its subdirectories.
|
24
|
+
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
|
25
|
+
|
26
|
+
# Requires factories and other useful helpers defined in spree_core.
|
27
|
+
require 'spree/testing_support/authorization_helpers'
|
28
|
+
require 'spree/testing_support/capybara_ext'
|
29
|
+
require 'spree/testing_support/controller_requests'
|
30
|
+
require 'spree/testing_support/factories'
|
31
|
+
require 'spree/testing_support/url_helpers'
|
32
|
+
|
33
|
+
# Requires factories defined in lib/spree_counties/factories.rb
|
34
|
+
require 'spree_counties/factories'
|
35
|
+
|
36
|
+
RSpec.configure do |config|
|
37
|
+
config.include FactoryGirl::Syntax::Methods
|
38
|
+
|
39
|
+
# Infer an example group's spec type from the file location.
|
40
|
+
config.infer_spec_type_from_file_location!
|
41
|
+
|
42
|
+
# == URL Helpers
|
43
|
+
#
|
44
|
+
# Allows access to Spree's routes in specs:
|
45
|
+
#
|
46
|
+
# visit spree.admin_path
|
47
|
+
# current_path.should eql(spree.products_path)
|
48
|
+
config.include Spree::TestingSupport::UrlHelpers
|
49
|
+
|
50
|
+
# == Mock Framework
|
51
|
+
#
|
52
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
53
|
+
#
|
54
|
+
# config.mock_with :mocha
|
55
|
+
# config.mock_with :flexmock
|
56
|
+
# config.mock_with :rr
|
57
|
+
config.mock_with :rspec
|
58
|
+
config.color = true
|
59
|
+
|
60
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
61
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
62
|
+
|
63
|
+
# Capybara javascript drivers require transactional fixtures set to false, and we use DatabaseCleaner
|
64
|
+
# to cleanup after each test instead. Without transactional fixtures set to false the records created
|
65
|
+
# to setup a test will be unavailable to the browser, which runs under a separate server instance.
|
66
|
+
config.use_transactional_fixtures = false
|
67
|
+
|
68
|
+
# Ensure Suite is set to use transactions for speed.
|
69
|
+
config.before :suite do
|
70
|
+
DatabaseCleaner.strategy = :transaction
|
71
|
+
DatabaseCleaner.clean_with :truncation
|
72
|
+
end
|
73
|
+
|
74
|
+
# Before each spec check if it is a Javascript test and switch between using database transactions or not where necessary.
|
75
|
+
config.before :each do
|
76
|
+
DatabaseCleaner.strategy = RSpec.current_example.metadata[:js] ? :truncation : :transaction
|
77
|
+
DatabaseCleaner.start
|
78
|
+
end
|
79
|
+
|
80
|
+
# After each spec clean the database.
|
81
|
+
config.after :each do
|
82
|
+
DatabaseCleaner.clean
|
83
|
+
end
|
84
|
+
|
85
|
+
config.fail_fast = ENV['FAIL_FAST'] || false
|
86
|
+
config.order = "random"
|
87
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
Gem::Specification.new do |s|
|
3
|
+
s.platform = Gem::Platform::RUBY
|
4
|
+
s.name = 'spree_counties'
|
5
|
+
s.version = '1.0.0'
|
6
|
+
s.summary = 'Lets your users pick counties from states list in address\'s step'
|
7
|
+
s.description = 'Add county model to address'
|
8
|
+
s.required_ruby_version = '>= 1.9.3'
|
9
|
+
|
10
|
+
s.author = 'Gonzalo Moreno'
|
11
|
+
s.email = 'gmoreno@acid.cl'
|
12
|
+
s.homepage = 'http://www.acid.cl'
|
13
|
+
s.license = 'MIT'
|
14
|
+
|
15
|
+
s.files = `git ls-files`.split("\n")
|
16
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
|
+
s.require_path = 'lib'
|
18
|
+
s.requirements << 'none'
|
19
|
+
|
20
|
+
s.add_dependency('spree_core', '~> 2.1')
|
21
|
+
|
22
|
+
s.add_development_dependency 'capybara', '~> 2.4'
|
23
|
+
s.add_development_dependency 'coffee-rails'
|
24
|
+
s.add_development_dependency 'database_cleaner'
|
25
|
+
s.add_development_dependency 'factory_girl', '~> 4.4'
|
26
|
+
s.add_development_dependency 'ffaker'
|
27
|
+
s.add_development_dependency 'rspec-rails', '~> 3.1'
|
28
|
+
s.add_development_dependency 'sass-rails', '~> 4.0.2'
|
29
|
+
s.add_development_dependency 'selenium-webdriver'
|
30
|
+
s.add_development_dependency 'simplecov'
|
31
|
+
s.add_development_dependency 'sqlite3'
|
32
|
+
end
|