spree_sample 0.70.7 → 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. data/LICENSE +2 -2
  2. data/db/sample/{addresses.yml → spree/addresses.yml} +0 -1
  3. data/db/sample/spree/adjustments.yml +26 -0
  4. data/db/sample/{assets.yml → spree/assets.yml} +64 -64
  5. data/db/sample/spree/calculators.yml +22 -0
  6. data/db/sample/{inventory_units.rb → spree/inventory_units.rb} +3 -3
  7. data/db/sample/{line_items.yml → spree/line_items.yml} +0 -0
  8. data/db/sample/{option_types.yml → spree/option_types.yml} +0 -0
  9. data/db/sample/{option_values.yml → spree/option_values.yml} +0 -0
  10. data/db/sample/{orders.yml → spree/orders.yml} +2 -2
  11. data/db/sample/{payment_methods.yml → spree/payment_methods.yml} +5 -5
  12. data/db/sample/spree/payments.rb +25 -0
  13. data/db/sample/spree/preferences.rb +14 -0
  14. data/db/sample/{product_groups.yml → spree/product_groups.yml} +0 -0
  15. data/db/sample/{product_option_types.yml → spree/product_option_types.yml} +0 -0
  16. data/db/sample/{product_properties.yml → spree/product_properties.yml} +0 -0
  17. data/db/sample/{product_scopes.yml → spree/product_scopes.yml} +0 -0
  18. data/db/sample/spree/{apache_baseball.png → products/apache_baseball.png} +0 -0
  19. data/db/sample/spree/{ror_bag.jpeg → products/ror_bag.jpeg} +0 -0
  20. data/db/sample/spree/{ror_baseball.jpeg → products/ror_baseball.jpeg} +0 -0
  21. data/db/sample/spree/{ror_baseball_back.jpeg → products/ror_baseball_back.jpeg} +0 -0
  22. data/db/sample/spree/{ror_baseball_jersey_back_blue.png → products/ror_baseball_jersey_back_blue.png} +0 -0
  23. data/db/sample/spree/{ror_baseball_jersey_back_green.png → products/ror_baseball_jersey_back_green.png} +0 -0
  24. data/db/sample/spree/{ror_baseball_jersey_back_red.png → products/ror_baseball_jersey_back_red.png} +0 -0
  25. data/db/sample/spree/{ror_baseball_jersey_blue.png → products/ror_baseball_jersey_blue.png} +0 -0
  26. data/db/sample/spree/{ror_baseball_jersey_green.png → products/ror_baseball_jersey_green.png} +0 -0
  27. data/db/sample/spree/{ror_baseball_jersey_red.png → products/ror_baseball_jersey_red.png} +0 -0
  28. data/db/sample/spree/{ror_jr_spaghetti.jpeg → products/ror_jr_spaghetti.jpeg} +0 -0
  29. data/db/sample/spree/{ror_mug.jpeg → products/ror_mug.jpeg} +0 -0
  30. data/db/sample/spree/{ror_mug_back.jpeg → products/ror_mug_back.jpeg} +0 -0
  31. data/db/sample/spree/{ror_ringer.jpeg → products/ror_ringer.jpeg} +0 -0
  32. data/db/sample/spree/{ror_ringer_back.jpeg → products/ror_ringer_back.jpeg} +0 -0
  33. data/db/sample/spree/{ror_stein.jpeg → products/ror_stein.jpeg} +0 -0
  34. data/db/sample/spree/{ror_stein_back.jpeg → products/ror_stein_back.jpeg} +0 -0
  35. data/db/sample/spree/{ror_tote.jpeg → products/ror_tote.jpeg} +0 -0
  36. data/db/sample/spree/{ror_tote_back.jpeg → products/ror_tote_back.jpeg} +0 -0
  37. data/db/sample/spree/{ruby_baseball.png → products/ruby_baseball.png} +0 -0
  38. data/db/sample/{products.rb → spree/products.rb} +2 -2
  39. data/db/sample/{products.yml → spree/products.yml} +0 -0
  40. data/db/sample/{properties.yml → spree/properties.yml} +0 -0
  41. data/db/sample/{prototypes.yml → spree/prototypes.yml} +0 -0
  42. data/db/sample/{shipments.yml → spree/shipments.yml} +0 -0
  43. data/db/sample/{shipping_categories.yml → spree/shipping_categories.yml} +0 -0
  44. data/db/sample/{shipping_methods.yml → spree/shipping_methods.yml} +0 -0
  45. data/db/sample/{tax_categories.yml → spree/tax_categories.yml} +0 -0
  46. data/db/sample/{tax_rates.yml → spree/tax_rates.yml} +0 -0
  47. data/db/sample/{taxonomies.yml → spree/taxonomies.yml} +0 -0
  48. data/db/sample/{taxons.rb → spree/taxons.rb} +2 -2
  49. data/db/sample/{taxons.yml → spree/taxons.yml} +0 -0
  50. data/db/sample/spree/update_memberships.rb +1 -0
  51. data/db/sample/{users.yml → spree/users.yml} +0 -0
  52. data/db/sample/{variants.yml → spree/variants.yml} +0 -0
  53. data/lib/tasks/sample.rake +4 -2
  54. metadata +72 -66
  55. data/db/sample/adjustments.yml +0 -24
  56. data/db/sample/calculators.yml +0 -22
  57. data/db/sample/payments.rb +0 -25
  58. data/db/sample/preferences.yml +0 -20
  59. data/db/sample/update_memberships.rb +0 -1
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2007-2011, Rails Dog LLC and other contributors
1
+ Copyright (c) 2007-2011, Spree Commerce, Inc. and other contributors
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification,
@@ -23,4 +23,4 @@ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
23
  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24
24
  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25
25
  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,5 +1,4 @@
1
1
  <%
2
- require 'faker'
3
2
  I18n.reload!
4
3
  1.upto(100) do |i|
5
4
  %>
@@ -0,0 +1,26 @@
1
+ <% 1.upto(100) do |i| %>
2
+ tax_<%= i %>:
3
+ adjustable: order_<%= i %>
4
+ adjustable_type: Spree::Order
5
+ amount: 0
6
+ source: order_<%= i %>
7
+ source_type: Spree::Order
8
+ originator: tax_rate_north_america
9
+ originator_type: Spree::TaxRate
10
+ label: Tax
11
+ locked: false
12
+ mandatory: true
13
+ <% end %>
14
+ <% 1.upto(100) do |i| %>
15
+ ship_<%= i %>:
16
+ adjustable_id: order_<%= i %>
17
+ adjustable_type: Spree::Order
18
+ amount: 5
19
+ source: shipment_<%= i %>
20
+ source_type: Spree::Shipment
21
+ originator: ups_ground
22
+ originator_type: Spree::ShippingMethod
23
+ label: Shipping
24
+ locked: true
25
+ mandatory: true
26
+ <% end %>
@@ -1,320 +1,320 @@
1
1
  img_tote:
2
2
  id: 1
3
3
  viewable: ror_tote
4
- viewable_type: Product
4
+ viewable_type: Spree::Product
5
5
  attachment_content_type: image/jpg
6
6
  attachment_file_name: ror_tote.jpeg
7
7
  attachment_width: 360
8
8
  attachment_height: 360
9
- type: Image
9
+ type: Spree::Image
10
10
  position: 1
11
11
  img_tote_back:
12
12
  id: 2
13
13
  viewable: ror_tote
14
- viewable_type: Product
14
+ viewable_type: Spree::Product
15
15
  attachment_content_type: image/jpg
16
16
  attachment_file_name: ror_tote_back.jpeg
17
17
  attachment_width: 360
18
18
  attachment_height: 360
19
- type: Image
19
+ type: Spree::Image
20
20
  position: 2
21
21
  img_bag:
22
22
  id: 3
23
23
  viewable: ror_bag
24
- viewable_type: Product
24
+ viewable_type: Spree::Product
25
25
  attachment_content_type: image/jpg
26
26
  attachment_file_name: ror_bag.jpeg
27
27
  attachment_width: 360
28
28
  attachment_height: 360
29
- type: Image
29
+ type: Spree::Image
30
30
  position: 1
31
31
  img_baseball:
32
32
  id: 4
33
33
  viewable: ror_baseball_jersey
34
- viewable_type: Product
34
+ viewable_type: Spree::Product
35
35
  attachment_content_type: image/jpg
36
36
  attachment_file_name: ror_baseball.jpeg
37
37
  attachment_width: 360
38
38
  attachment_height: 360
39
- type: Image
39
+ type: Spree::Image
40
40
  position: 1
41
41
  img_baseball_back:
42
42
  id: 5
43
43
  viewable: ror_baseball_jersey
44
- viewable_type: Product
44
+ viewable_type: Spree::Product
45
45
  attachment_content_type: image/jpg
46
46
  attachment_file_name: ror_baseball_back.jpeg
47
47
  attachment_width: 360
48
48
  attachment_height: 360
49
- type: Image
49
+ type: Spree::Image
50
50
  position: 2
51
51
  img_jr_spaghetti:
52
52
  id: 6
53
53
  viewable: ror_jr_spaghetti
54
- viewable_type: Product
54
+ viewable_type: Spree::Product
55
55
  attachment_content_type: image/jpg
56
56
  attachment_file_name: ror_jr_spaghetti.jpeg
57
57
  attachment_width: 360
58
58
  attachment_height: 360
59
- type: Image
59
+ type: Spree::Image
60
60
  position: 1
61
61
  img_mug:
62
62
  id: 7
63
63
  viewable: ror_mug
64
- viewable_type: Product
64
+ viewable_type: Spree::Product
65
65
  attachment_content_type: image/jpg
66
66
  attachment_file_name: ror_mug.jpeg
67
67
  attachment_width: 360
68
68
  attachment_height: 360
69
- type: Image
69
+ type: Spree::Image
70
70
  position: 1
71
71
  img_mug_back:
72
72
  id: 8
73
73
  viewable: ror_mug
74
- viewable_type: Product
74
+ viewable_type: Spree::Product
75
75
  attachment_content_type: image/jpg
76
76
  attachment_file_name: ror_mug_back.jpeg
77
77
  attachment_width: 360
78
78
  attachment_height: 360
79
- type: Image
79
+ type: Spree::Image
80
80
  position: 2
81
81
  img_ringer:
82
82
  id: 9
83
83
  viewable: ror_ringer
84
- viewable_type: Product
84
+ viewable_type: Spree::Product
85
85
  attachment_content_type: image/jpg
86
86
  attachment_file_name: ror_ringer.jpeg
87
87
  attachment_width: 360
88
88
  attachment_height: 360
89
- type: Image
89
+ type: Spree::Image
90
90
  position: 1
91
91
  img_ringer_back:
92
92
  id: 10
93
93
  viewable: ror_ringer
94
- viewable_type: Product
94
+ viewable_type: Spree::Product
95
95
  attachment_content_type: image/jpg
96
96
  attachment_file_name: ror_ringer_back.jpeg
97
97
  attachment_width: 360
98
98
  attachment_height: 360
99
- type: Image
99
+ type: Spree::Image
100
100
  position: 2
101
101
  img_stein:
102
102
  id: 11
103
103
  viewable: ror_stein
104
- viewable_type: Product
104
+ viewable_type: Spree::Product
105
105
  attachment_content_type: image/jpg
106
106
  attachment_file_name: ror_stein.jpeg
107
107
  attachment_width: 360
108
108
  attachment_height: 360
109
- type: Image
109
+ type: Spree::Image
110
110
  position: 1
111
111
  img_stein_back:
112
112
  id: 12
113
113
  viewable: ror_stein
114
- viewable_type: Product
114
+ viewable_type: Spree::Product
115
115
  attachment_content_type: image/jpg
116
116
  attachment_file_name: ror_stein_back.jpeg
117
117
  attachment_width: 360
118
118
  attachment_height: 360
119
- type: Image
119
+ type: Spree::Image
120
120
  position: 2
121
121
  img_apache_baseball:
122
122
  id: 1004
123
123
  viewable: apache_baseball_jersey
124
- viewable_type: Product
124
+ viewable_type: Spree::Product
125
125
  attachment_content_type: image/png
126
126
  attachment_file_name: apache_baseball.png
127
127
  attachment_width: 504
128
128
  attachment_height: 484
129
- type: Image
129
+ type: Spree::Image
130
130
  position: 1
131
131
  img_ruby_baseball:
132
132
  id: 1008
133
133
  viewable: ruby_baseball_jersey
134
- viewable_type: Product
134
+ viewable_type: Spree::Product
135
135
  attachment_content_type: image/png
136
136
  attachment_file_name: ruby_baseball.png
137
137
  attachment_width: 495
138
138
  attachment_height: 477
139
- type: Image
139
+ type: Spree::Image
140
140
  position: 1
141
141
  img_baseball_small_green:
142
142
  id: 1009
143
143
  viewable: small-green-baseball
144
- viewable_type: Variant
144
+ viewable_type: Spree::Variant
145
145
  attachment_content_type: image/png
146
146
  attachment_file_name: ror_baseball_jersey_green.png
147
147
  attachment_width: 240
148
148
  attachment_height: 240
149
- type: Image
149
+ type: Spree::Image
150
150
  position: 1
151
151
  img_baseball_small_green_back:
152
152
  id: 1010
153
153
  viewable: small-green-baseball
154
- viewable_type: Variant
154
+ viewable_type: Spree::Variant
155
155
  attachment_content_type: image/png
156
156
  attachment_file_name: ror_baseball_jersey_back_green.png
157
157
  attachment_width: 240
158
158
  attachment_height: 240
159
- type: Image
159
+ type: Spree::Image
160
160
  position: 2
161
161
  img_baseball_med_green:
162
162
  id: 1011
163
163
  viewable: med-green-baseball
164
- viewable_type: Variant
164
+ viewable_type: Spree::Variant
165
165
  attachment_content_type: image/png
166
166
  attachment_file_name: ror_baseball_jersey_green.png
167
167
  attachment_width: 240
168
168
  attachment_height: 240
169
- type: Image
169
+ type: Spree::Image
170
170
  position: 1
171
171
  img_baseball_med_green_back:
172
172
  id: 1012
173
173
  viewable: med-green-baseball
174
- viewable_type: Variant
174
+ viewable_type: Spree::Variant
175
175
  attachment_content_type: image/png
176
176
  attachment_file_name: ror_baseball_jersey_back_green.png
177
177
  attachment_width: 240
178
178
  attachment_height: 240
179
- type: Image
179
+ type: Spree::Image
180
180
  position: 2
181
181
  img_baseball_large_green:
182
182
  id: 1013
183
183
  viewable: large-green-baseball
184
- viewable_type: Variant
184
+ viewable_type: Spree::Variant
185
185
  attachment_content_type: image/png
186
186
  attachment_file_name: ror_baseball_jersey_green.png
187
187
  attachment_width: 240
188
188
  attachment_height: 240
189
- type: Image
189
+ type: Spree::Image
190
190
  position: 1
191
191
  img_baseball_large_green_back:
192
192
  id: 1014
193
193
  viewable: large-green-baseball
194
- viewable_type: Variant
194
+ viewable_type: Spree::Variant
195
195
  attachment_content_type: image/png
196
196
  attachment_file_name: ror_baseball_jersey_back_green.png
197
197
  attachment_width: 240
198
198
  attachment_height: 240
199
- type: Image
199
+ type: Spree::Image
200
200
  position: 2
201
201
  img_baseball_small_blue:
202
202
  id: 1015
203
203
  viewable: small-blue-baseball
204
- viewable_type: Variant
204
+ viewable_type: Spree::Variant
205
205
  attachment_content_type: image/png
206
206
  attachment_file_name: ror_baseball_jersey_blue.png
207
207
  attachment_width: 240
208
208
  attachment_height: 240
209
- type: Image
209
+ type: Spree::Image
210
210
  position: 1
211
211
  img_baseball_small_blue_back:
212
212
  id: 1016
213
213
  viewable: small-blue-baseball
214
- viewable_type: Variant
214
+ viewable_type: Spree::Variant
215
215
  attachment_content_type: image/png
216
216
  attachment_file_name: ror_baseball_jersey_back_blue.png
217
217
  attachment_width: 240
218
218
  attachment_height: 240
219
- type: Image
219
+ type: Spree::Image
220
220
  position: 2
221
221
  img_baseball_med_blue:
222
222
  id: 1017
223
223
  viewable: med-blue-baseball
224
- viewable_type: Variant
224
+ viewable_type: Spree::Variant
225
225
  attachment_content_type: image/png
226
226
  attachment_file_name: ror_baseball_jersey_blue.png
227
227
  attachment_width: 240
228
228
  attachment_height: 240
229
- type: Image
229
+ type: Spree::Image
230
230
  position: 1
231
231
  img_baseball_med_blue_back:
232
232
  id: 1018
233
233
  viewable: med-blue-baseball
234
- viewable_type: Variant
234
+ viewable_type: Spree::Variant
235
235
  attachment_content_type: image/png
236
236
  attachment_file_name: ror_baseball_jersey_back_blue.png
237
237
  attachment_width: 240
238
238
  attachment_height: 240
239
- type: Image
239
+ type: Spree::Image
240
240
  position: 2
241
241
  img_baseball_large_blue:
242
242
  id: 1019
243
243
  viewable: large-blue-baseball
244
- viewable_type: Variant
244
+ viewable_type: Spree::Variant
245
245
  attachment_content_type: image/png
246
246
  attachment_file_name: ror_baseball_jersey_blue.png
247
247
  attachment_width: 240
248
248
  attachment_height: 240
249
- type: Image
249
+ type: Spree::Image
250
250
  position: 1
251
251
  img_baseball_large_blue_back:
252
252
  id: 1020
253
253
  viewable: large-blue-baseball
254
- viewable_type: Variant
254
+ viewable_type: Spree::Variant
255
255
  attachment_content_type: image/png
256
256
  attachment_file_name: ror_baseball_jersey_back_blue.png
257
257
  attachment_width: 240
258
258
  attachment_height: 240
259
- type: Image
259
+ type: Spree::Image
260
260
  position: 2
261
261
  img_baseball_large_red:
262
262
  id: 1021
263
263
  viewable: large-red-baseball
264
- viewable_type: Variant
264
+ viewable_type: Spree::Variant
265
265
  attachment_content_type: image/png
266
266
  attachment_file_name: ror_baseball_jersey_red.png
267
267
  attachment_width: 240
268
268
  attachment_height: 240
269
- type: Image
269
+ type: Spree::Image
270
270
  position: 1
271
271
  img_baseball_large_red_back:
272
272
  id: 1022
273
273
  viewable: large-red-baseball
274
- viewable_type: Variant
274
+ viewable_type: Spree::Variant
275
275
  attachment_content_type: image/png
276
276
  attachment_file_name: ror_baseball_jersey_back_red.png
277
277
  attachment_width: 240
278
278
  attachment_height: 240
279
- type: Image
279
+ type: Spree::Image
280
280
  position: 2
281
281
  img_baseball_med_red:
282
282
  id: 1023
283
283
  viewable: med-red-baseball
284
- viewable_type: Variant
284
+ viewable_type: Spree::Variant
285
285
  attachment_content_type: image/png
286
286
  attachment_file_name: ror_baseball_jersey_red.png
287
287
  attachment_width: 240
288
288
  attachment_height: 240
289
- type: Image
289
+ type: Spree::Image
290
290
  position: 1
291
291
  img_baseball_med_red_back:
292
292
  id: 1024
293
293
  viewable: med-red-baseball
294
- viewable_type: Variant
294
+ viewable_type: Spree::Variant
295
295
  attachment_content_type: image/png
296
296
  attachment_file_name: ror_baseball_jersey_back_red.png
297
297
  attachment_width: 240
298
298
  attachment_height: 240
299
- type: Image
299
+ type: Spree::Image
300
300
  position: 2
301
301
  img_baseball_small_red:
302
302
  id: 1025
303
303
  viewable: small-red-baseball
304
- viewable_type: Variant
304
+ viewable_type: Spree::Variant
305
305
  attachment_content_type: image/png
306
306
  attachment_file_name: ror_baseball_jersey_red.png
307
307
  attachment_width: 240
308
308
  attachment_height: 240
309
- type: Image
309
+ type: Spree::Image
310
310
  position: 1
311
311
  img_baseball_small_red_back:
312
312
  id: 1026
313
313
  viewable: small-red-baseball
314
- viewable_type: Variant
314
+ viewable_type: Spree::Variant
315
315
  attachment_content_type: image/png
316
316
  attachment_file_name: ror_baseball_jersey_back_red.png
317
317
  attachment_width: 240
318
318
  attachment_height: 240
319
- type: Image
319
+ type: Spree::Image
320
320
  position: 2
@@ -0,0 +1,22 @@
1
+ ups_ground:
2
+ calculable: ups_ground
3
+ calculable_type: Spree::ShippingMethod
4
+ type: Spree::Calculator::FlatRate
5
+ ups_two_day:
6
+ calculable: ups_two_day
7
+ calculable_type: Spree::ShippingMethod
8
+ type: Spree::Calculator::FlatRate
9
+ ups_one_day:
10
+ calculable: ups_one_day
11
+ calculable_type: Spree::ShippingMethod
12
+ type: Spree::Calculator::FlatRate
13
+ flat_rate_coupon_calculator:
14
+ calculable: spree_coupon
15
+ calculable_type: Spree::Promotion
16
+ type: Spree::Calculator::FlatRate
17
+ tax_rate_calculator:
18
+ calculable: tax_rate_north_america
19
+ calculable_type: Spree::TaxRate
20
+ type: Spree::Calculator::DefaultTax
21
+
22
+
@@ -1,4 +1,4 @@
1
1
  # create the inventory units associated with the line item (we need to do this after the fixture b/c quantity is random)
2
- LineItem.all.each do |li|
3
- li.quantity.times { li.order.inventory_units.create(:variant => li.variant, :state => "sold", :shipment => li.order.shipment) }
4
- end
2
+ Spree::LineItem.all.each do |li|
3
+ li.quantity.times { li.order.inventory_units.create(:variant => li.variant, :state => 'sold', :shipment => li.order.shipment) }
4
+ end
File without changes
@@ -11,8 +11,8 @@ order_<%= i %>:
11
11
  state: complete
12
12
  email: <%= Faker::Internet.email %>
13
13
  item_total: <%= item_total %>
14
- created_at: <%=order_date.to_s(:db)%>
15
- completed_at: <%=order_date.to_s(:db)%>
14
+ created_at: <%= order_date.to_s(:db) %>
15
+ completed_at: <%= order_date.to_s(:db) %>
16
16
  total: <%= item_total + charges_total %>
17
17
  adjustment_total: <%= charges_total %>
18
18
  ship_address: ship_address_<%= i %>
@@ -3,27 +3,27 @@ bogus_dev:
3
3
  description: Bogus payment gateway for development.
4
4
  environment: development
5
5
  active: true
6
- type: Gateway::Bogus
6
+ type: Spree::Gateway::Bogus
7
7
  check_method:
8
8
  name: Check
9
9
  description: Pay by check.
10
10
  active: true
11
- type: PaymentMethod::Check
11
+ type: Spree::PaymentMethod::Check
12
12
  bogus_test:
13
13
  name: Credit Card
14
14
  description: Bogus payment gateway for test.
15
15
  environment: test
16
16
  active: true
17
- type: Gateway::Bogus
17
+ type: Spree::Gateway::Bogus
18
18
  bogus_prod:
19
19
  name: Credit Card
20
20
  description: Bogus payment gateway for production.
21
21
  environment: production
22
22
  active: true
23
- type: Gateway::Bogus
23
+ type: Spree::Gateway::Bogus
24
24
  bogus_staging:
25
25
  name: Credit Card
26
26
  description: Bogus payment gateway for staging.
27
27
  environment: staging
28
28
  active: true
29
- type: Gateway::Bogus
29
+ type: Spree::Gateway::Bogus
@@ -0,0 +1,25 @@
1
+ # create payments based on the totals since they can't be known in YAML (quantities are random)
2
+ method = Spree::PaymentMethod.where(:name => 'Credit Card', :active => true).first
3
+
4
+ # Hack the current method so we're able to return a gateway without a RAILS_ENV
5
+ Spree::Gateway.class_eval do
6
+ def self.current
7
+ Spree::Gateway::Bogus.new
8
+ end
9
+ end
10
+
11
+ creditcard = Spree::Creditcard.create(:cc_type => 'visa', :month => 12, :year => 2014, :last_digits => '1111',
12
+ :first_name => 'Sean', :last_name => 'Schofield',
13
+ :gateway_customer_profile_id => 'BGS-1234')
14
+
15
+ Spree::Order.all.each_with_index do |order,index|
16
+ printf "\rProcessing order #{index}"
17
+ STDOUT.flush
18
+ order.update!
19
+ payment = order.payments.create(:amount => order.total, :source => creditcard.clone, :payment_method => method)
20
+ payment.update_attributes_without_callbacks({
21
+ :state => 'pending',
22
+ :response_code => '12345'
23
+ })
24
+ end
25
+ puts
@@ -0,0 +1,14 @@
1
+ shipping_method = Spree::ShippingMethod.find_by_name("UPS Ground")
2
+ shipping_method.calculator.preferred_amount = 5
3
+
4
+ shipping_method = Spree::ShippingMethod.find_by_name("UPS One Day")
5
+ shipping_method.calculator.preferred_amount = 15
6
+
7
+ shipping_method = Spree::ShippingMethod.find_by_name("UPS Two Day")
8
+ shipping_method.calculator.preferred_amount = 10
9
+
10
+ # flat_rate_five_dollars:
11
+ # name: amount
12
+ # owner: flat_rate_coupon_calculator
13
+ # owner_type: Spree::Calculator
14
+ # value: 5
@@ -1,10 +1,10 @@
1
1
  # make sure the product images directory exists
2
2
  FileUtils.mkdir_p "#{Rails.root}/public/spree/products/"
3
3
 
4
- Asset.all.each do |asset|
4
+ Spree::Asset.all.each do |asset|
5
5
  filename = asset.attachment_file_name
6
6
  puts "-- Processing image: #{filename}\r"
7
- path = File.join(File.dirname(__FILE__), "spree/#{filename}")
7
+ path = File.join(File.dirname(__FILE__), "products/#{filename}")
8
8
 
9
9
  if FileTest.exists? path
10
10
  asset.attachment = File.open(path)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +1,3 @@
1
1
  # Fixtures were created for acts_as_adjency_list, but now we have nested set, so we need to rebuild it after import
2
- Taxon.rebuild!
3
- Taxon.all.each{|t| t.send(:set_permalink); t.save}
2
+ Spree::Taxon.rebuild!
3
+ Spree::Taxon.all.each{ |t| t.send(:set_permalink); t.save }
File without changes
@@ -0,0 +1 @@
1
+ Spree::ProductGroup.all.each { |pg| pg.update_memberships }
File without changes
File without changes
@@ -1,9 +1,11 @@
1
+ require 'ffaker'
2
+
1
3
  namespace :spree_sample do
2
- desc "Loads sample data"
4
+ desc 'Loads sample data'
3
5
  task :load do
4
6
  sample_path = File.join(File.dirname(__FILE__), '..', '..', 'db', 'sample')
5
7
 
6
8
  Rake::Task['db:load_dir'].reenable
7
- Rake::Task["db:load_dir"].invoke( sample_path )
9
+ Rake::Task['db:load_dir'].invoke(sample_path)
8
10
  end
9
11
  end
metadata CHANGED
@@ -1,13 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_sample
3
3
  version: !ruby/object:Gem::Version
4
- hash: 265
5
- prerelease:
4
+ hash: 15424055
5
+ prerelease: 6
6
6
  segments:
7
+ - 1
7
8
  - 0
8
- - 70
9
- - 7
10
- version: 0.70.7
9
+ - 0
10
+ - rc
11
+ - 1
12
+ version: 1.0.0.rc1
11
13
  platform: ruby
12
14
  authors:
13
15
  - Sean Schofield
@@ -15,7 +17,7 @@ autorequire:
15
17
  bindir: bin
16
18
  cert_chain: []
17
19
 
18
- date: 2012-07-08 00:00:00 Z
20
+ date: 2011-12-23 00:00:00 Z
19
21
  dependencies:
20
22
  - !ruby/object:Gem::Dependency
21
23
  version_requirements: &id001 !ruby/object:Gem::Requirement
@@ -23,12 +25,14 @@ dependencies:
23
25
  requirements:
24
26
  - - "="
25
27
  - !ruby/object:Gem::Version
26
- hash: 265
28
+ hash: 15424055
27
29
  segments:
30
+ - 1
31
+ - 0
28
32
  - 0
29
- - 70
30
- - 7
31
- version: 0.70.7
33
+ - rc
34
+ - 1
35
+ version: 1.0.0.rc1
32
36
  requirement: *id001
33
37
  type: :runtime
34
38
  prerelease: false
@@ -45,57 +49,57 @@ files:
45
49
  - LICENSE
46
50
  - lib/spree_sample.rb
47
51
  - lib/tasks/sample.rake
48
- - db/sample/addresses.yml
49
- - db/sample/adjustments.yml
50
- - db/sample/assets.yml
51
- - db/sample/calculators.yml
52
- - db/sample/inventory_units.rb
53
- - db/sample/line_items.yml
54
- - db/sample/option_types.yml
55
- - db/sample/option_values.yml
56
- - db/sample/orders.yml
57
- - db/sample/payment_methods.yml
58
- - db/sample/payments.rb
59
- - db/sample/preferences.yml
60
- - db/sample/product_groups.yml
61
- - db/sample/product_option_types.yml
62
- - db/sample/product_properties.yml
63
- - db/sample/product_scopes.yml
64
- - db/sample/products.rb
65
- - db/sample/products.yml
66
- - db/sample/properties.yml
67
- - db/sample/prototypes.yml
68
- - db/sample/shipments.yml
69
- - db/sample/shipping_categories.yml
70
- - db/sample/shipping_methods.yml
71
- - db/sample/spree/apache_baseball.png
72
- - db/sample/spree/ror_bag.jpeg
73
- - db/sample/spree/ror_baseball.jpeg
74
- - db/sample/spree/ror_baseball_back.jpeg
75
- - db/sample/spree/ror_baseball_jersey_back_blue.png
76
- - db/sample/spree/ror_baseball_jersey_back_green.png
77
- - db/sample/spree/ror_baseball_jersey_back_red.png
78
- - db/sample/spree/ror_baseball_jersey_blue.png
79
- - db/sample/spree/ror_baseball_jersey_green.png
80
- - db/sample/spree/ror_baseball_jersey_red.png
81
- - db/sample/spree/ror_jr_spaghetti.jpeg
82
- - db/sample/spree/ror_mug.jpeg
83
- - db/sample/spree/ror_mug_back.jpeg
84
- - db/sample/spree/ror_ringer.jpeg
85
- - db/sample/spree/ror_ringer_back.jpeg
86
- - db/sample/spree/ror_stein.jpeg
87
- - db/sample/spree/ror_stein_back.jpeg
88
- - db/sample/spree/ror_tote.jpeg
89
- - db/sample/spree/ror_tote_back.jpeg
90
- - db/sample/spree/ruby_baseball.png
91
- - db/sample/tax_categories.yml
92
- - db/sample/tax_rates.yml
93
- - db/sample/taxonomies.yml
94
- - db/sample/taxons.rb
95
- - db/sample/taxons.yml
96
- - db/sample/update_memberships.rb
97
- - db/sample/users.yml
98
- - db/sample/variants.yml
52
+ - db/sample/spree/addresses.yml
53
+ - db/sample/spree/adjustments.yml
54
+ - db/sample/spree/assets.yml
55
+ - db/sample/spree/calculators.yml
56
+ - db/sample/spree/inventory_units.rb
57
+ - db/sample/spree/line_items.yml
58
+ - db/sample/spree/option_types.yml
59
+ - db/sample/spree/option_values.yml
60
+ - db/sample/spree/orders.yml
61
+ - db/sample/spree/payment_methods.yml
62
+ - db/sample/spree/payments.rb
63
+ - db/sample/spree/preferences.rb
64
+ - db/sample/spree/product_groups.yml
65
+ - db/sample/spree/product_option_types.yml
66
+ - db/sample/spree/product_properties.yml
67
+ - db/sample/spree/product_scopes.yml
68
+ - db/sample/spree/products/apache_baseball.png
69
+ - db/sample/spree/products/ror_bag.jpeg
70
+ - db/sample/spree/products/ror_baseball.jpeg
71
+ - db/sample/spree/products/ror_baseball_back.jpeg
72
+ - db/sample/spree/products/ror_baseball_jersey_back_blue.png
73
+ - db/sample/spree/products/ror_baseball_jersey_back_green.png
74
+ - db/sample/spree/products/ror_baseball_jersey_back_red.png
75
+ - db/sample/spree/products/ror_baseball_jersey_blue.png
76
+ - db/sample/spree/products/ror_baseball_jersey_green.png
77
+ - db/sample/spree/products/ror_baseball_jersey_red.png
78
+ - db/sample/spree/products/ror_jr_spaghetti.jpeg
79
+ - db/sample/spree/products/ror_mug.jpeg
80
+ - db/sample/spree/products/ror_mug_back.jpeg
81
+ - db/sample/spree/products/ror_ringer.jpeg
82
+ - db/sample/spree/products/ror_ringer_back.jpeg
83
+ - db/sample/spree/products/ror_stein.jpeg
84
+ - db/sample/spree/products/ror_stein_back.jpeg
85
+ - db/sample/spree/products/ror_tote.jpeg
86
+ - db/sample/spree/products/ror_tote_back.jpeg
87
+ - db/sample/spree/products/ruby_baseball.png
88
+ - db/sample/spree/products.rb
89
+ - db/sample/spree/products.yml
90
+ - db/sample/spree/properties.yml
91
+ - db/sample/spree/prototypes.yml
92
+ - db/sample/spree/shipments.yml
93
+ - db/sample/spree/shipping_categories.yml
94
+ - db/sample/spree/shipping_methods.yml
95
+ - db/sample/spree/tax_categories.yml
96
+ - db/sample/spree/tax_rates.yml
97
+ - db/sample/spree/taxonomies.yml
98
+ - db/sample/spree/taxons.rb
99
+ - db/sample/spree/taxons.yml
100
+ - db/sample/spree/update_memberships.rb
101
+ - db/sample/spree/users.yml
102
+ - db/sample/spree/variants.yml
99
103
  homepage: http://spreecommerce.com
100
104
  licenses: []
101
105
 
@@ -118,15 +122,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
118
122
  required_rubygems_version: !ruby/object:Gem::Requirement
119
123
  none: false
120
124
  requirements:
121
- - - ">="
125
+ - - ">"
122
126
  - !ruby/object:Gem::Version
123
- hash: 3
127
+ hash: 25
124
128
  segments:
125
- - 0
126
- version: "0"
129
+ - 1
130
+ - 3
131
+ - 1
132
+ version: 1.3.1
127
133
  requirements:
128
134
  - none
129
- rubyforge_project: spree_sample
135
+ rubyforge_project:
130
136
  rubygems_version: 1.8.10
131
137
  signing_key:
132
138
  specification_version: 3
@@ -1,24 +0,0 @@
1
- <% 1.upto(100) do |i| %>
2
- tax_<%= i %>:
3
- order: order_<%= i %>
4
- amount: 0
5
- source: order_<%= i %>
6
- source_type: Order
7
- originator:
8
- originator_type:
9
- label: Tax
10
- locked: false
11
- mandatory: true
12
- <% end %>
13
- <% 1.upto(100) do |i| %>
14
- ship_<%= i %>:
15
- order: order_<%= i %>
16
- amount: 5
17
- source: shipment_<%= i %>
18
- source_type: Shipment
19
- originator:
20
- originator_type:
21
- label: Shipping
22
- locked: true
23
- mandatory: true
24
- <% end %>
@@ -1,22 +0,0 @@
1
- ups_ground:
2
- calculable: ups_ground
3
- calculable_type: ShippingMethod
4
- type: Calculator::FlatRate
5
- ups_two_day:
6
- calculable: ups_two_day
7
- calculable_type: ShippingMethod
8
- type: Calculator::FlatRate
9
- ups_one_day:
10
- calculable: ups_one_day
11
- calculable_type: ShippingMethod
12
- type: Calculator::FlatRate
13
- flat_rate_coupon_calculator:
14
- calculable: spree_coupon
15
- calculable_type: Promotion
16
- type: Calculator::FlatRate
17
- tax_rate_calculator:
18
- calculable: tax_rate_north_america
19
- calculable_type: TaxRate
20
- type: Calculator::SalesTax
21
-
22
-
@@ -1,25 +0,0 @@
1
- # create payments based on the totals since they can't be known in YAML (quantities are random)
2
- method = PaymentMethod.find(:first, :conditions => {:name => "Credit Card", :active => true})
3
-
4
- # Hack the current method so we're able to return a gateway without a RAILS_ENV
5
- Gateway.class_eval do
6
- def self.current
7
- Gateway::Bogus.new
8
- end
9
- end
10
-
11
- creditcard = Creditcard.create(:cc_type => "visa", :month => 12, :year => 2014, :last_digits => "1111",
12
- :first_name => "Sean", :last_name => "Schofield",
13
- :gateway_customer_profile_id => "BGS-1234")
14
-
15
- Order.all.each_with_index do |order,index|
16
- printf "\rProcessing order #{index}"
17
- STDOUT.flush
18
- order.update!
19
- payment = order.payments.create(:amount => order.total, :source => creditcard.clone, :payment_method => method)
20
- payment.update_attributes_without_callbacks({
21
- :state => "pending",
22
- :response_code => "12345"
23
- })
24
- end
25
- puts
@@ -1,20 +0,0 @@
1
- flat_rate_ground:
2
- name: amount
3
- owner: ups_ground
4
- owner_type: Calculator
5
- value: 5
6
- flat_rate_two_day:
7
- name: amount
8
- owner: ups_two_day
9
- owner_type: Calculator
10
- value: 10
11
- flat_rate_one_day:
12
- name: amount
13
- owner: ups_one_day
14
- owner_type: Calculator
15
- value: 15
16
- flat_rate_five_dollars:
17
- name: amount
18
- owner: flat_rate_coupon_calculator
19
- owner_type: Calculator
20
- value: 5
@@ -1 +0,0 @@
1
- ProductGroup.all.each {|pg| pg.update_memberships}