solidus_sample 2.9.6 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/db/samples/addresses.rb +5 -8
  3. data/db/samples/assets.rb +79 -40
  4. data/db/samples/images/ruby_hoodie.jpg +0 -0
  5. data/db/samples/images/ruby_hoodie_zip.jpg +0 -0
  6. data/db/samples/images/ruby_mug.jpg +0 -0
  7. data/db/samples/images/ruby_polo.jpg +0 -0
  8. data/db/samples/images/ruby_polo_back.jpg +0 -0
  9. data/db/samples/images/solidus_girly.jpg +0 -0
  10. data/db/samples/images/solidus_girly_black.png +0 -0
  11. data/db/samples/images/solidus_girly_blue.png +0 -0
  12. data/db/samples/images/solidus_girly_white.png +0 -0
  13. data/db/samples/images/solidus_hoodie.jpg +0 -0
  14. data/db/samples/images/solidus_long.jpg +0 -0
  15. data/db/samples/images/solidus_long_back.jpg +0 -0
  16. data/db/samples/images/solidus_long_back_black.png +0 -0
  17. data/db/samples/images/solidus_long_back_blue.png +0 -0
  18. data/db/samples/images/solidus_long_back_white.png +0 -0
  19. data/db/samples/images/solidus_long_black.png +0 -0
  20. data/db/samples/images/solidus_long_blue.png +0 -0
  21. data/db/samples/images/solidus_long_white.png +0 -0
  22. data/db/samples/images/solidus_mug.jpg +0 -0
  23. data/db/samples/images/solidus_snapback_cap.jpg +0 -0
  24. data/db/samples/images/solidus_tshirt.jpg +0 -0
  25. data/db/samples/images/solidus_tshirt_back.jpg +0 -0
  26. data/db/samples/images/solidus_tshirt_back_black.png +0 -0
  27. data/db/samples/images/solidus_tshirt_back_blue.png +0 -0
  28. data/db/samples/images/solidus_tshirt_back_white.png +0 -0
  29. data/db/samples/images/solidus_tshirt_black.png +0 -0
  30. data/db/samples/images/solidus_tshirt_blue.png +0 -0
  31. data/db/samples/images/solidus_tshirt_white.png +0 -0
  32. data/db/samples/images/tote_bag_ruby.jpg +0 -0
  33. data/db/samples/images/tote_bag_solidus.jpg +0 -0
  34. data/db/samples/option_values.rb +13 -1
  35. data/db/samples/orders.rb +3 -3
  36. data/db/samples/product_option_types.rb +3 -3
  37. data/db/samples/product_properties.rb +78 -28
  38. data/db/samples/products.rb +97 -27
  39. data/db/samples/reimbursements.rb +35 -12
  40. data/db/samples/taxons.rb +58 -40
  41. data/db/samples/variants.rb +149 -62
  42. data/solidus_sample.gemspec +5 -5
  43. metadata +40 -33
  44. data/db/samples/images/apache_baseball.png +0 -0
  45. data/db/samples/images/ror_bag.jpeg +0 -0
  46. data/db/samples/images/ror_baseball.jpeg +0 -0
  47. data/db/samples/images/ror_baseball_back.jpeg +0 -0
  48. data/db/samples/images/ror_baseball_jersey_back_blue.png +0 -0
  49. data/db/samples/images/ror_baseball_jersey_back_green.png +0 -0
  50. data/db/samples/images/ror_baseball_jersey_back_red.png +0 -0
  51. data/db/samples/images/ror_baseball_jersey_blue.png +0 -0
  52. data/db/samples/images/ror_baseball_jersey_green.png +0 -0
  53. data/db/samples/images/ror_baseball_jersey_red.png +0 -0
  54. data/db/samples/images/ror_jr_spaghetti.jpeg +0 -0
  55. data/db/samples/images/ror_mug.jpeg +0 -0
  56. data/db/samples/images/ror_mug_back.jpeg +0 -0
  57. data/db/samples/images/ror_ringer.jpeg +0 -0
  58. data/db/samples/images/ror_ringer_back.jpeg +0 -0
  59. data/db/samples/images/ror_stein.jpeg +0 -0
  60. data/db/samples/images/ror_stein_back.jpeg +0 -0
  61. data/db/samples/images/ror_tote.jpeg +0 -0
  62. data/db/samples/images/ror_tote_back.jpeg +0 -0
  63. data/db/samples/images/ruby_baseball.png +0 -0
  64. data/spec/lib/load_sample_spec.rb +0 -12
  65. data/spec/spec_helper.rb +0 -41
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e7942df77a04fbde36f508e291459018390f860fead59dd7cc86ef35f8c94f10
4
- data.tar.gz: d225e6b98fba7d565b8924627c459bf46bc6c9ee32469f79939841fb8af85a69
3
+ metadata.gz: 0f8a2f2ab2e3f9f51dfb9d1d5ab2bdc9471cd48d2a562374c23583c2e8c3ac55
4
+ data.tar.gz: 880e79010e04dc08d956023fb441df657aa9dbbb3d2e8b4d0f1a0a3d3fc1563a
5
5
  SHA512:
6
- metadata.gz: 420ed878d6075914f34a68e9f2fe27e19edd1232f3c0d7351a3762b34f2e06f5f937350042374dcd3d3c1b0311bbdb44dfa0f5bb948ff6cdc55efc435af7dee5
7
- data.tar.gz: c242ff48f63219f0e3e67062e814bcb103310a944b7b81d156434bec419e802e2b7e06dbf1cb2f0a65b3fa765e6a6e33c31a512f7f9e5d91a6c464f968deb7d9
6
+ metadata.gz: bd36a810e3671961280a86c569d097641322cceec4a2e7f62874e475257b283856e3e0a26d525c72632b0514ba142de955a6afd6659da3c6dc57f0ea6504319d
7
+ data.tar.gz: 1c966dc593f5da08e27dd9a3d9466965046a8ac599e1000e171951d8fe965c26bc92948f08546b243d576baeb770d798ccbcec333560ec21620815cd05ecff2d
@@ -3,12 +3,10 @@
3
3
  united_states = Spree::Country.find_by!(iso: "US")
4
4
  new_york = Spree::State.find_by!(name: "New York")
5
5
 
6
- first_names = ["Sterling", "Jennette", "Salome", "Lyla", "Lola", "Cheree",
7
- "Hettie", "Barbie", "Amelia", "Marceline", "Keeley", "Mi",
8
- "Karon", "Jessika", "Emmy"]
9
- last_names = ["Torp", "Vandervort", "Stroman", "Lang", "Zulauf", "Bruen",
10
- "Torp", "Gutmann", "Renner", "Bergstrom", "Sauer", "Gaylord",
11
- "Mills", "Daugherty", "Stark"]
6
+ names = ["Sterling Torp", "Jennette Vandervort", "Salome Stroman", "Lyla Lang",
7
+ "Lola Zulauf", "Cheree Bruen", "Hettie Torp", "Barbie Gutmann",
8
+ "Amelia Renner", "Marceline Bergstrom", "Keeley Sauer", "Mi Gaylord",
9
+ "Karon Mills", "Jessika Daugherty", "Emmy Stark"]
12
10
  street_addresses = ["7377 Jacobi Passage", "4725 Serena Ridges",
13
11
  "79832 Hamill Creek", "0746 Genoveva Villages",
14
12
  "86717 D'Amore Hollow", "8529 Delena Well",
@@ -28,8 +26,7 @@ phone_numbers = ["(392)859-7319 x670", "738-831-3210 x6047",
28
26
 
29
27
  2.times do
30
28
  Spree::Address.create!(
31
- firstname: first_names.sample,
32
- lastname: last_names.sample,
29
+ name: names.sample,
33
30
  address1: street_addresses.sample,
34
31
  address2: secondary_addresses.sample,
35
32
  city: cities.sample,
@@ -4,99 +4,138 @@ Spree::Sample.load_sample("products")
4
4
  Spree::Sample.load_sample("variants")
5
5
 
6
6
  products = {}
7
- products[:ror_baseball_jersey] = Spree::Product.find_by!(name: "Ruby on Rails Baseball Jersey")
8
- products[:ror_tote] = Spree::Product.find_by!(name: "Ruby on Rails Tote")
9
- products[:ror_bag] = Spree::Product.find_by!(name: "Ruby on Rails Bag")
10
- products[:ror_jr_spaghetti] = Spree::Product.find_by!(name: "Ruby on Rails Jr. Spaghetti")
11
- products[:ror_mug] = Spree::Product.find_by!(name: "Ruby on Rails Mug")
12
- products[:ror_ringer] = Spree::Product.find_by!(name: "Ruby on Rails Ringer T-Shirt")
13
- products[:ror_stein] = Spree::Product.find_by!(name: "Ruby on Rails Stein")
14
- products[:ruby_baseball_jersey] = Spree::Product.find_by!(name: "Ruby Baseball Jersey")
15
- products[:apache_baseball_jersey] = Spree::Product.find_by!(name: "Apache Baseball Jersey")
7
+ products[:solidus_tshirt] = Spree::Product.includes(variants: [:option_values]).find_by!(name: "Solidus T-Shirt")
8
+ products[:solidus_long] = Spree::Product.includes(variants: [:option_values]).find_by!(name: "Solidus Long Sleeve")
9
+ products[:solidus_girly] = Spree::Product.includes(variants: [:option_values]).find_by!(name: "Solidus Girly")
10
+ products[:solidus_snapback_cap] = Spree::Product.find_by!(name: "Solidus Snapback Cap")
11
+ products[:solidus_hoodie] = Spree::Product.find_by!(name: "Solidus Hoodie Zip")
12
+ products[:ruby_hoodie] = Spree::Product.find_by!(name: "Ruby Hoodie")
13
+ products[:ruby_hoodie_zip] = Spree::Product.find_by!(name: "Ruby Hoodie Zip")
14
+ products[:ruby_polo] = Spree::Product.find_by!(name: "Ruby Polo")
15
+ products[:solidus_mug] = Spree::Product.find_by!(name: "Solidus Mug")
16
+ products[:ruby_mug] = Spree::Product.find_by!(name: "Ruby Mug")
17
+ products[:solidus_tote] = Spree::Product.find_by!(name: "Solidus Tote")
18
+ products[:ruby_tote] = Spree::Product.find_by!(name: "Ruby Tote")
16
19
 
17
- def image(name, type = "jpeg")
20
+ def image(name, type = "jpg")
18
21
  images_path = Pathname.new(File.dirname(__FILE__)) + "images"
19
22
  path = images_path + "#{name}.#{type}"
23
+
20
24
  return false if !File.exist?(path)
25
+
21
26
  path
22
27
  end
23
28
 
24
29
  images = {
25
- products[:ror_tote].master => [
30
+ products[:solidus_tshirt].master => [
26
31
  {
27
- attachment: image("ror_tote")
32
+ attachment: image("solidus_tshirt")
28
33
  },
29
34
  {
30
- attachment: image("ror_tote_back")
35
+ attachment: image("solidus_tshirt_back")
31
36
  }
32
37
  ],
33
- products[:ror_bag].master => [
38
+ products[:solidus_long].master => [
34
39
  {
35
- attachment: image("ror_bag")
40
+ attachment: image("solidus_long")
41
+ },
42
+ {
43
+ attachment: image("solidus_long_back")
36
44
  }
37
45
  ],
38
- products[:ror_baseball_jersey].master => [
46
+ products[:solidus_snapback_cap].master => [
39
47
  {
40
- attachment: image("ror_baseball")
41
- },
42
- {
43
- attachment: image("ror_baseball_back")
48
+ attachment: image("solidus_snapback_cap")
44
49
  }
45
50
  ],
46
- products[:ror_jr_spaghetti].master => [
51
+ products[:solidus_hoodie].master => [
47
52
  {
48
- attachment: image("ror_jr_spaghetti")
53
+ attachment: image("solidus_hoodie")
49
54
  }
50
55
  ],
51
- products[:ror_mug].master => [
56
+ products[:ruby_hoodie].master => [
52
57
  {
53
- attachment: image("ror_mug")
54
- },
58
+ attachment: image("ruby_hoodie")
59
+ }
60
+ ],
61
+ products[:ruby_hoodie_zip].master => [
55
62
  {
56
- attachment: image("ror_mug_back")
63
+ attachment: image("ruby_hoodie_zip")
57
64
  }
58
65
  ],
59
- products[:ror_ringer].master => [
66
+ products[:ruby_polo].master => [
60
67
  {
61
- attachment: image("ror_ringer")
68
+ attachment: image("ruby_polo")
62
69
  },
63
70
  {
64
- attachment: image("ror_ringer_back")
71
+ attachment: image("ruby_polo_back")
65
72
  }
66
73
  ],
67
- products[:ror_stein].master => [
74
+ products[:solidus_mug].master => [
68
75
  {
69
- attachment: image("ror_stein")
70
- },
76
+ attachment: image("solidus_mug")
77
+ }
78
+ ],
79
+ products[:ruby_mug].master => [
71
80
  {
72
- attachment: image("ror_stein_back")
81
+ attachment: image("ruby_mug")
73
82
  }
74
83
  ],
75
- products[:apache_baseball_jersey].master => [
84
+ products[:solidus_tote].master => [
76
85
  {
77
- attachment: image("apache_baseball", "png")
86
+ attachment: image("tote_bag_solidus")
78
87
  }
79
88
  ],
80
- products[:ruby_baseball_jersey].master => [
89
+ products[:ruby_tote].master => [
81
90
  {
82
- attachment: image("ruby_baseball", "png")
91
+ attachment: image("tote_bag_ruby")
92
+ }
93
+ ],
94
+ products[:solidus_girly].master => [
95
+ {
96
+ attachment: image("solidus_girly")
83
97
  }
84
98
  ]
85
99
  }
86
100
 
87
- products[:ror_baseball_jersey].variants.each do |variant|
101
+ products[:solidus_tshirt].variants.each do |variant|
88
102
  color = variant.option_value("tshirt-color").downcase
89
- main_image = image("ror_baseball_jersey_#{color}", "png")
103
+ main_image = image("solidus_tshirt_#{color}", "png")
90
104
  File.open(main_image) do |f|
91
105
  variant.images.create!(attachment: f)
92
106
  end
93
- back_image = image("ror_baseball_jersey_back_#{color}", "png")
107
+ back_image = image("solidus_tshirt_back_#{color}", "png")
108
+
94
109
  next unless back_image
110
+
95
111
  File.open(back_image) do |f|
96
112
  variant.images.create!(attachment: f)
97
113
  end
98
114
  end
99
115
 
116
+ products[:solidus_long].variants.each do |variant|
117
+ color = variant.option_value("tshirt-color").downcase
118
+ main_image = image("solidus_long_#{color}", "png")
119
+ File.open(main_image) do |f|
120
+ variant.images.create!(attachment: f)
121
+ end
122
+ back_image = image("solidus_long_back_#{color}", "png")
123
+
124
+ next unless back_image
125
+
126
+ File.open(back_image) do |f|
127
+ variant.images.create!(attachment: f)
128
+ end
129
+ end
130
+
131
+ products[:solidus_girly].reload.variants.each do |variant|
132
+ color = variant.option_value("tshirt-color").downcase
133
+ main_image = image("solidus_girly_#{color}", "png")
134
+ File.open(main_image) do |f|
135
+ variant.images.create!(attachment: f)
136
+ end
137
+ end
138
+
100
139
  images.each do |variant, attachments|
101
140
  puts "Loading images for #{variant.product.name}"
102
141
  attachments.each do |attachment|
@@ -33,12 +33,24 @@ Spree::OptionValue.create!([
33
33
  {
34
34
  name: "Red",
35
35
  presentation: "Red",
36
- position: 1,
36
+ position: 5,
37
37
  option_type: color
38
38
  },
39
39
  {
40
40
  name: "Green",
41
41
  presentation: "Green",
42
+ position: 4,
43
+ option_type: color
44
+ },
45
+ {
46
+ name: "Black",
47
+ presentation: "Black",
48
+ position: 1,
49
+ option_type: color
50
+ },
51
+ {
52
+ name: "White",
53
+ presentation: "White",
42
54
  position: 2,
43
55
  option_type: color
44
56
  },
@@ -28,20 +28,20 @@ orders << Spree::Order.create!(
28
28
  )
29
29
 
30
30
  orders[0].line_items.create!(
31
- variant: Spree::Product.find_by!(name: "Ruby on Rails Tote").master,
31
+ variant: Spree::Product.find_by!(name: "Solidus Tote").master,
32
32
  quantity: 1,
33
33
  price: 15.99
34
34
  )
35
35
 
36
36
  orders[1].line_items.create!(
37
- variant: Spree::Product.find_by!(name: "Ruby on Rails Bag").master,
37
+ variant: Spree::Product.find_by!(name: "Solidus Snapback Cap").master,
38
38
  quantity: 1,
39
39
  price: 22.99
40
40
  )
41
41
 
42
42
  orders.each do |order|
43
43
  order.payments.create!(payment_method: payment_method)
44
- order.update_attributes(store: store)
44
+ order.update(store: store)
45
45
 
46
46
  order.next! while !order.can_complete?
47
47
  order.complete!
@@ -5,6 +5,6 @@ Spree::Sample.load_sample("products")
5
5
  size = Spree::OptionType.find_by!(presentation: "Size")
6
6
  color = Spree::OptionType.find_by!(presentation: "Color")
7
7
 
8
- ror_baseball_jersey = Spree::Product.find_by!(name: "Ruby on Rails Baseball Jersey")
9
- ror_baseball_jersey.option_types = [size, color]
10
- ror_baseball_jersey.save!
8
+ solidus_tshirt = Spree::Product.find_by!(name: "Solidus T-Shirt")
9
+ solidus_tshirt.option_types = [size, color]
10
+ solidus_tshirt.save!
@@ -2,60 +2,110 @@
2
2
 
3
3
  products =
4
4
  {
5
- "Ruby on Rails Baseball Jersey" =>
5
+ "Solidus Tote" =>
6
+ {
7
+ "Type" => "Tote",
8
+ "Size" => %{15" x 18" x 6"},
9
+ "Material" => "Canvas"
10
+ },
11
+ "Ruby Tote" =>
12
+ {
13
+ "Type" => "Tote",
14
+ "Size" => %{15" x 18" x 6"},
15
+ "Material" => "Canvas"
16
+ },
17
+ "Solidus Snapback Cap" =>
18
+ {
19
+ "Type" => "Snapback Cap",
20
+ "Size" => "One Size",
21
+ "Material" => "100% Cotton"
22
+ },
23
+ "Solidus T-Shirt" =>
24
+ {
25
+ "Manufacturer" => "Jerseys",
26
+ "Brand" => "Conditioned",
27
+ "Model" => "TL9002",
28
+ "Shirt Type" => "Ringer T",
29
+ "Sleeve Type" => "Short",
30
+ "Made from" => "100% Cotton",
31
+ "Fit" => "Loose",
32
+ "Gender" => "Men's"
33
+ },
34
+ "Solidus Long Sleeve" =>
6
35
  {
7
36
  "Manufacturer" => "Wilson",
8
37
  "Brand" => "Wannabe Sports",
9
- "Model" => "JK1002",
10
- "Shirt Type" => "Baseball Jersey",
38
+ "Model" => "TL9002",
39
+ "Shirt Type" => "Jersey",
11
40
  "Sleeve Type" => "Long",
12
41
  "Made from" => "100% cotton",
13
42
  "Fit" => "Loose",
14
43
  "Gender" => "Men's"
15
44
  },
16
- "Ruby on Rails Jr. Spaghetti" =>
45
+ "Solidus Hoodie Zip" =>
17
46
  {
18
47
  "Manufacturer" => "Jerseys",
48
+ "Brand" => "Wannabe Sports",
49
+ "Model" => "HD9001",
50
+ "Shirt Type" => "Jersey",
51
+ "Sleeve Type" => "Long",
52
+ "Made from" => "100% cotton",
53
+ "Fit" => "Loose",
54
+ "Gender" => "Unisex"
55
+ },
56
+ "Ruby Hoodie" =>
57
+ {
58
+ "Manufacturer" => "Wilson",
19
59
  "Brand" => "Resiliance",
20
- "Model" => "TL174",
21
- "Shirt Type" => "Jr. Spaghetti T",
22
- "Sleeve Type" => "None",
60
+ "Model" => "HD2001",
61
+ "Shirt Type" => "Baseball",
62
+ "Sleeve Type" => "Long",
23
63
  "Made from" => "90% Cotton, 10% Nylon",
24
- "Fit" => "Form",
25
- "Gender" => "Women's"
64
+ "Fit" => "Loose",
65
+ "Gender" => "Unisex"
26
66
  },
27
- "Ruby on Rails Ringer T-Shirt" =>
67
+ "Ruby Hoodie Zip" =>
28
68
  {
29
69
  "Manufacturer" => "Jerseys",
30
- "Brand" => "Conditioned",
31
- "Model" => "TL9002",
32
- "Shirt Type" => "Ringer T",
33
- "Sleeve Type" => "Short",
34
- "Made from" => "100% Vellum",
70
+ "Brand" => "Wannabe Sports",
71
+ "Model" => "HD9001",
72
+ "Shirt Type" => "Jersey",
73
+ "Sleeve Type" => "Long",
74
+ "Made from" => "100% cotton",
35
75
  "Fit" => "Loose",
36
- "Gender" => "Men's"
76
+ "Gender" => "Unisex"
37
77
  },
38
- "Ruby on Rails Tote" =>
78
+ "Ruby Polo" =>
39
79
  {
40
- "Type" => "Tote",
41
- "Size" => %{15" x 18" x 6"},
42
- "Material" => "Canvas"
80
+ "Manufacturer" => "Wilson",
81
+ "Brand" => "Resiliance",
82
+ "Model" => "PL9001",
83
+ "Shirt Type" => "Ringer T",
84
+ "Sleeve Type" => "Short",
85
+ "Made from" => "100% Cotton",
86
+ "Fit" => "Slim",
87
+ "Gender" => "Men's"
43
88
  },
44
- "Ruby on Rails Bag" =>
89
+ "Solidus Mug" =>
45
90
  {
46
- "Type" => "Messenger",
47
- "Size" => %{14 1/2" x 12" x 5"},
48
- "Material" => "600 Denier Polyester"
91
+ "Type" => "Mug",
92
+ "Size" => %{4.5" tall, 3.25" dia.}
49
93
  },
50
- "Ruby on Rails Mug" =>
94
+ "Ruby Mug" =>
51
95
  {
52
96
  "Type" => "Mug",
53
97
  "Size" => %{4.5" tall, 3.25" dia.}
54
98
  },
55
- "Ruby on Rails Stein" =>
99
+ "Solidus Girly" =>
56
100
  {
57
- "Type" => "Stein",
58
- "Size" => %{6.75" tall, 3.75" dia. base, 3" dia. rim}
101
+ "Manufacturer" => "Jerseys",
102
+ "Brand" => "Conditioned",
103
+ "Model" => "WM6001",
104
+ "Shirt Type" => "Skinny",
105
+ "Sleeve Type" => "Short",
106
+ "Made from" => "90% Cotton, 10% Nylon",
107
+ "Fit" => "Slim",
108
+ "Gender" => "Women's"
59
109
  }
60
110
  }
61
111