spree_sample 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ed7cc3ecd9c35a71ef3d195721765532219d098
4
- data.tar.gz: 66bf9f991881120b3eb495697bf25ac18b0e77cf
3
+ metadata.gz: 79d60525fdc78c2d424d76b34a53fcb6c46e52c4
4
+ data.tar.gz: bbe6ba2d4cf57c645b1411a69734789f8fe190ee
5
5
  SHA512:
6
- metadata.gz: 17dbbc5915ab7f5135f95a22a3c45d47f5a794cb68755d59d4d6fecf50c00afbaa9a58c36ed9bc723fea0022df082fb681e0dcef90dc054b042620587b70dd7a
7
- data.tar.gz: 30a5eae8d8acc8a79b890b3d7356264a8044befa07d420483913137dcb9e1ae0068bef67528bd1ea65268289fbd6b847673b0b1c98b6528d705eacde56ef696a
6
+ metadata.gz: 3726b23b0a598e23bed3bfb714dbb80d0649f2fba1206a418b1dccfad0915a7ae08f5b8b34c08f06a889fdebbb0ecc2d367324159aca4e7be62165dc7732ba9a
7
+ data.tar.gz: 0502d5a123c1cf4ac7c317d05b7ab05d5a17674da00c515a5fc3f3f4c47b668f51620be1523e02137dafdfa24f362b568d227ecd468c34e72855197a8e007a00
@@ -151,6 +151,7 @@ products[:ror_baseball_jersey].variants.each do |variant|
151
151
  end
152
152
 
153
153
  images.each do |variant, attachments|
154
+ puts "Loading images for #{variant.name}"
154
155
  attachments.each do |attachment|
155
156
  variant.images.create!(attachment)
156
157
  end
@@ -1,16 +1 @@
1
1
  Spree::Sample.load_sample("orders")
2
-
3
- first_order = Spree::Order.find_by_number!("R123456789")
4
- last_order = Spree::Order.find_by_number!("R987654321")
5
-
6
- first_order.line_items.create!({
7
- :variant => Spree::Product.find_by_name!("Ruby on Rails Tote").master,
8
- :quantity => 1,
9
- :price => 15.99
10
- }, :without_protection => true)
11
-
12
- last_order.line_items.create!({
13
- :variant => Spree::Product.find_by_name!("Ruby on Rails Bag").master,
14
- :quantity => 1,
15
- :price => 22.99
16
- }, :without_protection => true)
@@ -1,6 +1,7 @@
1
1
  Spree::Sample.load_sample("addresses")
2
2
 
3
- order = Spree::Order.create!({
3
+ orders = []
4
+ orders << Spree::Order.create!({
4
5
  :number => "R123456789",
5
6
  :email => "spree@example.com",
6
7
  :item_total => 150.95,
@@ -9,10 +10,8 @@ order = Spree::Order.create!({
9
10
  :shipping_address => Spree::Address.first,
10
11
  :billing_address => Spree::Address.last
11
12
  }, :without_protection => true)
12
- order.state = "complete"
13
- order.save!
14
13
 
15
- order = Spree::Order.create!({
14
+ orders << Spree::Order.create!({
16
15
  :number => "R987654321",
17
16
  :email => "spree@example.com",
18
17
  :item_total => 15.95,
@@ -21,6 +20,23 @@ order = Spree::Order.create!({
21
20
  :shipping_address => Spree::Address.first,
22
21
  :billing_address => Spree::Address.last
23
22
  }, :without_protection => true)
24
- order.state = "complete"
25
- order.save!
26
23
 
24
+ orders[0].line_items.create!({
25
+ :variant => Spree::Product.find_by_name!("Ruby on Rails Tote").master,
26
+ :quantity => 1,
27
+ :price => 15.99
28
+ }, :without_protection => true)
29
+
30
+ orders[1].line_items.create!({
31
+ :variant => Spree::Product.find_by_name!("Ruby on Rails Bag").master,
32
+ :quantity => 1,
33
+ :price => 22.99
34
+ }, :without_protection => true)
35
+
36
+ orders.each(&:create_proposed_shipments)
37
+
38
+ orders.each do |order|
39
+ order.state = "complete"
40
+ order.completed_at = Time.now - 1.day
41
+ order.save!
42
+ end
@@ -1,6 +1,8 @@
1
1
  Spree::Sample.load_sample("tax_categories")
2
+ Spree::Sample.load_sample("shipping_categories")
2
3
 
3
4
  clothing = Spree::TaxCategory.find_by_name!("Clothing")
5
+ shipping_category = Spree::ShippingCategory.find_by_name!("Default Shipping")
4
6
 
5
7
  default_attrs = {
6
8
  :description => Faker::Lorem.paragraph,
@@ -11,30 +13,35 @@ products = [
11
13
  {
12
14
  :name => "Ruby on Rails Tote",
13
15
  :tax_category => clothing,
16
+ :shipping_category => shipping_category,
14
17
  :price => 15.99,
15
18
  :eur_price => 14,
16
19
  },
17
20
  {
18
21
  :name => "Ruby on Rails Bag",
19
22
  :tax_category => clothing,
23
+ :shipping_category => shipping_category,
20
24
  :price => 22.99,
21
25
  :eur_price => 19,
22
26
  },
23
27
  {
24
28
  :name => "Ruby on Rails Baseball Jersey",
25
29
  :tax_category => clothing,
30
+ :shipping_category => shipping_category,
26
31
  :price => 19.99,
27
32
  :eur_price => 16
28
33
  },
29
34
  {
30
35
  :name => "Ruby on Rails Jr. Spaghetti",
31
36
  :tax_category => clothing,
37
+ :shipping_category => shipping_category,
32
38
  :price => 19.99,
33
39
  :eur_price => 16
34
40
 
35
41
  },
36
42
  {
37
43
  :name => "Ruby on Rails Ringer T-Shirt",
44
+ :shipping_category => shipping_category,
38
45
  :tax_category => clothing,
39
46
  :price => 19.99,
40
47
  :eur_price => 16
@@ -42,62 +49,73 @@ products = [
42
49
  {
43
50
  :name => "Ruby Baseball Jersey",
44
51
  :tax_category => clothing,
52
+ :shipping_category => shipping_category,
45
53
  :price => 19.99,
46
54
  :eur_price => 16
47
55
  },
48
56
  {
49
57
  :name => "Apache Baseball Jersey",
50
58
  :tax_category => clothing,
59
+ :shipping_category => shipping_category,
51
60
  :price => 19.99,
52
61
  :eur_price => 16
53
62
  },
54
63
  {
55
64
  :name => "Spree Baseball Jersey",
56
65
  :tax_category => clothing,
66
+ :shipping_category => shipping_category,
57
67
  :price => 19.99,
58
68
  :eur_price => 16
59
69
  },
60
70
  {
61
71
  :name => "Spree Jr. Spaghetti",
62
72
  :tax_category => clothing,
73
+ :shipping_category => shipping_category,
63
74
  :price => 19.99,
64
75
  :eur_price => 16
65
76
  },
66
77
  {
67
78
  :name => "Spree Ringer T-Shirt",
68
79
  :tax_category => clothing,
80
+ :shipping_category => shipping_category,
69
81
  :price => 19.99,
70
82
  :eur_price => 16
71
83
  },
72
84
  {
73
85
  :name => "Spree Tote",
74
86
  :tax_category => clothing,
87
+ :shipping_category => shipping_category,
75
88
  :price => 15.99,
76
89
  :eur_price => 14,
77
90
  },
78
91
  {
79
92
  :name => "Spree Bag",
80
93
  :tax_category => clothing,
94
+ :shipping_category => shipping_category,
81
95
  :price => 22.99,
82
96
  :eur_price => 19
83
97
  },
84
98
  {
85
99
  :name => "Ruby on Rails Mug",
100
+ :shipping_category => shipping_category,
86
101
  :price => 13.99,
87
102
  :eur_price => 12
88
103
  },
89
104
  {
90
105
  :name => "Ruby on Rails Stein",
106
+ :shipping_category => shipping_category,
91
107
  :price => 16.99,
92
108
  :eur_price => 14
93
109
  },
94
110
  {
95
111
  :name => "Spree Stein",
112
+ :shipping_category => shipping_category,
96
113
  :price => 16.99,
97
114
  :eur_price => 14,
98
115
  },
99
116
  {
100
117
  :name => "Spree Mug",
118
+ :shipping_category => shipping_category,
101
119
  :price => 13.99,
102
120
  :eur_price => 12
103
121
  }
@@ -116,6 +116,6 @@ taxons = [
116
116
  taxons.each do |taxon_attrs|
117
117
  if taxon_attrs[:parent]
118
118
  taxon_attrs[:parent] = Spree::Taxon.find_by_name!(taxon_attrs[:parent])
119
+ Spree::Taxon.create!(taxon_attrs, :without_protection => true)
119
120
  end
120
- Spree::Taxon.create!(taxon_attrs, :without_protection => true)
121
121
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_sample
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-13 00:00:00.000000000 Z
11
+ date: 2013-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.0.3
19
+ version: 2.0.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.0.3
26
+ version: 2.0.4
27
27
  description: Required dependency for Spree
28
28
  email: sean@spreecommerce.com
29
29
  executables: []
@@ -79,7 +79,6 @@ files:
79
79
  - db/samples/product_properties.rb
80
80
  - db/samples/products.rb
81
81
  - db/samples/prototypes.rb
82
- - db/samples/shipments.rb
83
82
  - db/samples/shipping_categories.rb
84
83
  - db/samples/shipping_methods.rb
85
84
  - db/samples/stock.rb
@@ -1,18 +0,0 @@
1
- first_order = Spree::Order.find_by_number!("R123456789")
2
- last_order = Spree::Order.find_by_number!("R987654321")
3
-
4
- Spree::Shipment.create!({
5
- :order => first_order,
6
- :number => Array.new(11){rand(11)}.join,
7
- :shipping_method => Spree::ShippingMethod.find_by_name!("UPS Ground (USD)"),
8
- :address => Spree::Address.first,
9
- :state => "pending"
10
- }, :without_protection => true)
11
-
12
- Spree::Shipment.create!({
13
- :order => last_order,
14
- :number => Array.new(11){rand(11)}.join,
15
- :shipping_method => Spree::ShippingMethod.find_by_name!("UPS Ground (USD)"),
16
- :address => Spree::Address.first,
17
- :state => "pending"
18
- }, :without_protection => true)