spree_sample 5.1.8 → 5.2.0.rc1
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 +4 -4
- data/db/samples/metafields.rb +14 -0
- data/lib/spree_sample.rb +1 -1
- metadata +7 -7
- data/db/samples/product_properties.rb +0 -27
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ed9c561d3f294f4c0fff272613438d56de4629c14a808a0bad9e94ff78fdf947
|
|
4
|
+
data.tar.gz: 5263f3e58dad0f80fde1a1d7a0d8adf8ec8b6bd3d27ba20a8b0cb45e6428da2c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d9ce185fb7167725e84ada335f8a90cf02ddc25df8885289020b0fb70235740f3aa881d0bf0901a29ff68610da68b6dcd3e870e222e2ee727c515f02335f4594
|
|
7
|
+
data.tar.gz: 46567a71b3a09b410335647b8a1ecdb292c20de0d5a793848a894c2618be4a84a5fe91db862e6e5fc211ca8d1d193dc1a3d6896480a20de9b541647d537e97ce
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Spree::Sample.load_sample('products')
|
|
2
|
+
|
|
3
|
+
metafield_values = {
|
|
4
|
+
manufacturer: %w[Wilson Jerseys Wannabe Resiliance Conditioned],
|
|
5
|
+
material: ['90% Cotton 10% Elastan', '50% Cotton 50% Elastan', '10% Cotton 90% Elastan'],
|
|
6
|
+
fit: %w[Form Lose]
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
Spree::Product.find_each do |product|
|
|
10
|
+
product.set_metafield('properties.manufacturer', metafield_values[:manufacturer].sample)
|
|
11
|
+
product.set_metafield('properties.material', metafield_values[:material].sample)
|
|
12
|
+
product.set_metafield('properties.fit', metafield_values[:fit].sample)
|
|
13
|
+
product.save! if product.changed?
|
|
14
|
+
end
|
data/lib/spree_sample.rb
CHANGED
|
@@ -21,7 +21,7 @@ module SpreeSample
|
|
|
21
21
|
Spree::Sample.load_sample('option_values')
|
|
22
22
|
Spree::Sample.load_sample('products')
|
|
23
23
|
Spree::Sample.load_sample('variants')
|
|
24
|
-
Spree::Sample.load_sample('
|
|
24
|
+
Spree::Sample.load_sample('metafields')
|
|
25
25
|
Spree::Sample.load_sample('stock')
|
|
26
26
|
|
|
27
27
|
Spree::Sample.load_sample('orders')
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spree_sample
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.
|
|
4
|
+
version: 5.2.0.rc1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sean Schofield
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2025-
|
|
13
|
+
date: 2025-11-04 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: spree_core
|
|
@@ -18,14 +18,14 @@ dependencies:
|
|
|
18
18
|
requirements:
|
|
19
19
|
- - ">="
|
|
20
20
|
- !ruby/object:Gem::Version
|
|
21
|
-
version: 5.
|
|
21
|
+
version: 5.2.0.rc1
|
|
22
22
|
type: :runtime
|
|
23
23
|
prerelease: false
|
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
25
|
requirements:
|
|
26
26
|
- - ">="
|
|
27
27
|
- !ruby/object:Gem::Version
|
|
28
|
-
version: 5.
|
|
28
|
+
version: 5.2.0.rc1
|
|
29
29
|
- !ruby/object:Gem::Dependency
|
|
30
30
|
name: ffaker
|
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -52,13 +52,13 @@ files:
|
|
|
52
52
|
- db/samples.rb
|
|
53
53
|
- db/samples/addresses.rb
|
|
54
54
|
- db/samples/adjustments.rb
|
|
55
|
+
- db/samples/metafields.rb
|
|
55
56
|
- db/samples/option_types.rb
|
|
56
57
|
- db/samples/option_values.rb
|
|
57
58
|
- db/samples/orders.rb
|
|
58
59
|
- db/samples/payment_methods.rb
|
|
59
60
|
- db/samples/payments.rb
|
|
60
61
|
- db/samples/posts.rb
|
|
61
|
-
- db/samples/product_properties.rb
|
|
62
62
|
- db/samples/products.rb
|
|
63
63
|
- db/samples/promotions.rb
|
|
64
64
|
- db/samples/reimbursements.rb
|
|
@@ -79,9 +79,9 @@ licenses:
|
|
|
79
79
|
- BSD-3-Clause
|
|
80
80
|
metadata:
|
|
81
81
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
|
82
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v5.
|
|
82
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v5.2.0.rc1
|
|
83
83
|
documentation_uri: https://docs.spreecommerce.org/
|
|
84
|
-
source_code_uri: https://github.com/spree/spree/tree/v5.
|
|
84
|
+
source_code_uri: https://github.com/spree/spree/tree/v5.2.0.rc1
|
|
85
85
|
post_install_message:
|
|
86
86
|
rdoc_options: []
|
|
87
87
|
require_paths:
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
Spree::Sample.load_sample('products')
|
|
2
|
-
|
|
3
|
-
property_values = {
|
|
4
|
-
manufacturers: %w[Wilson Jerseys Wannabe Resiliance Conditioned],
|
|
5
|
-
brands: %w[Alpha Beta Gamma Delta Theta Epsilon Zeta],
|
|
6
|
-
materials: ['90% Cotton 10% Elastan', '50% Cotton 50% Elastan', '10% Cotton 90% Elastan'],
|
|
7
|
-
fits: %w[Form Lose]
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
properties = Spree::Property.insert_all([
|
|
11
|
-
{ name: 'manufacturer', presentation: 'Manufacturer' },
|
|
12
|
-
{ name: 'brand', presentation: 'Brand' },
|
|
13
|
-
{ name: 'material', presentation: 'Material' },
|
|
14
|
-
{ name: 'fit', presentation: 'Fit' },
|
|
15
|
-
])
|
|
16
|
-
|
|
17
|
-
properties_ids = properties.rows.flatten
|
|
18
|
-
properties_to_insert = Spree::Product.all.ids.flat_map do |product_id|
|
|
19
|
-
[
|
|
20
|
-
{ product_id: product_id, property_id: properties_ids.first, value: property_values[:manufacturers].sample },
|
|
21
|
-
{ product_id: product_id, property_id: properties_ids.second, value: property_values[:brands].sample },
|
|
22
|
-
{ product_id: product_id, property_id: properties_ids.third, value: property_values[:materials].sample },
|
|
23
|
-
{ product_id: product_id, property_id: properties_ids.fourth, value: property_values[:fits].sample },
|
|
24
|
-
]
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
Spree::ProductProperty.insert_all(properties_to_insert)
|