spree_sample 4.5.3 → 4.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/db/samples/data_feeds.rb +6 -0
- data/db/samples/option_types.rb +3 -1
- data/db/samples/product_properties.rb +0 -1
- data/db/samples/products.rb +9 -6
- data/db/samples/properties.rb +3 -1
- data/db/samples/stores.rb +3 -3
- data/db/samples/taxonomies.rb +5 -1
- data/db/samples/taxons.rb +37 -6
- data/lib/spree_sample.rb +2 -0
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c45eb3fae7b9b7b6d0663b68adda93cc4077ae9bda4fea4953440a9408e8bc45
|
4
|
+
data.tar.gz: 4f0873ce35dc211b7f49c3c4986160894624e19e6f2b7477efb22c1532f0c58e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bc4d40aa1691266b336ce05d538bf1fcb30e7887b77b67715999b0fe8adb4ec8ee1c9570e59267da1986b2b889fcb8d7ef4ae389d41154358ee8c23e0ffd0ee
|
7
|
+
data.tar.gz: 1b0c4f71620b325058970c047f1ddf23c9edca6bed53f347e0a8b2f3f6610179146f7e9c7211a54dac504d62400d23349d37449c64a0cd50139b64a88227d441
|
data/db/samples/option_types.rb
CHANGED
@@ -43,7 +43,6 @@ men_tshirts_properties = [
|
|
43
43
|
'gender' => 'Men\'s'
|
44
44
|
}
|
45
45
|
]
|
46
|
-
|
47
46
|
Spree::Taxon.find_by!(name: 'Men').children.find_by!(name: 'T-shirts').products.each do |product|
|
48
47
|
men_tshirts_properties.sample.each do |prop_name, prop_value|
|
49
48
|
product.set_property(prop_name, prop_value, prop_name.gsub('_', ' ').capitalize)
|
data/db/samples/products.rb
CHANGED
@@ -19,17 +19,20 @@ end.uniq
|
|
19
19
|
PRODUCTS.each do |(parent_name, taxon_name, product_name)|
|
20
20
|
parent = Spree::Taxon.find_by!(name: parent_name)
|
21
21
|
taxon = parent.children.find_by!(name: taxon_name)
|
22
|
-
Spree::Product.where(name: product_name.titleize).
|
22
|
+
next if Spree::Product.where(name: product_name.titleize).any?
|
23
|
+
|
24
|
+
Spree::Product.create!(name: product_name.titleize) do |product|
|
23
25
|
product.price = rand(10...100) + 0.99
|
24
26
|
product.description = FFaker::Lorem.paragraph
|
25
27
|
product.available_on = Time.zone.now
|
26
28
|
product.make_active_at = Time.zone.now
|
27
29
|
product.status = 'active'
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
product.option_types =
|
31
|
+
if parent_name == 'Women' && %w[Dresses Skirts].include?(taxon_name)
|
32
|
+
[color, length, size]
|
33
|
+
else
|
34
|
+
[color, size]
|
35
|
+
end
|
33
36
|
product.shipping_category = default_shipping_category
|
34
37
|
product.tax_category = clothing_tax_category
|
35
38
|
product.sku = [taxon_name.delete(' '), product_name.delete(' '), product.price].join('_')
|
data/db/samples/properties.rb
CHANGED
@@ -14,7 +14,9 @@ properties = {
|
|
14
14
|
}
|
15
15
|
|
16
16
|
properties.each do |name, presentation|
|
17
|
-
Spree::Property.where(name: name, presentation: presentation).
|
17
|
+
unless Spree::Property.where(name: name, presentation: presentation).exists?
|
18
|
+
Spree::Property.create!(name: name, presentation: presentation)
|
19
|
+
end
|
18
20
|
end
|
19
21
|
|
20
22
|
Spree::Property.where(name: %w[brand manufacturer]).update(filterable: true)
|
data/db/samples/stores.rb
CHANGED
@@ -3,12 +3,12 @@ default_store.checkout_zone = Spree::Zone.find_by(name: 'North America')
|
|
3
3
|
default_store.default_country = Spree::Country.find_by(iso: 'US')
|
4
4
|
default_store.supported_currencies = 'CAD,USD'
|
5
5
|
default_store.supported_locales = 'en,fr'
|
6
|
-
default_store.url = Rails.env.development? ? 'localhost:
|
6
|
+
default_store.url = Rails.env.development? ? 'localhost:4000' : 'demo.spreecommerce.org'
|
7
7
|
default_store.save!
|
8
8
|
|
9
9
|
eu_store = Spree::Store.find_or_initialize_by(code: 'eustore')
|
10
10
|
eu_store.name = 'EU Store'
|
11
|
-
eu_store.url = Rails.env.development? ? 'eu.lvh.me:
|
11
|
+
eu_store.url = Rails.env.development? ? 'eu.lvh.me:4000' : 'demo-eu.spreecommerce.org'
|
12
12
|
eu_store.mail_from_address = 'eustore@example.com'
|
13
13
|
eu_store.default_currency = 'EUR'
|
14
14
|
eu_store.default_locale = 'de'
|
@@ -19,7 +19,7 @@ eu_store.save!
|
|
19
19
|
|
20
20
|
uk_store = Spree::Store.find_or_initialize_by(code: 'ukstore')
|
21
21
|
uk_store.name = 'UK Store'
|
22
|
-
uk_store.url = Rails.env.development? ? 'uk.lvh.me:
|
22
|
+
uk_store.url = Rails.env.development? ? 'uk.lvh.me:4000' : 'demo-uk.spreecommerce.org'
|
23
23
|
uk_store.mail_from_address = 'ukstore@example.com'
|
24
24
|
uk_store.default_currency = 'GBP'
|
25
25
|
uk_store.default_locale = 'en'
|
data/db/samples/taxonomies.rb
CHANGED
@@ -8,5 +8,9 @@ taxonomies = [
|
|
8
8
|
]
|
9
9
|
|
10
10
|
taxonomies.each do |taxonomy_attrs|
|
11
|
-
Spree::Taxonomy.where(taxonomy_attrs).
|
11
|
+
if Spree::Taxonomy.where(taxonomy_attrs).any?
|
12
|
+
Spree::Taxonomy.where(taxonomy_attrs).first
|
13
|
+
else
|
14
|
+
Spree::Taxonomy.create!(taxonomy_attrs)
|
15
|
+
end
|
12
16
|
end
|
data/db/samples/taxons.rb
CHANGED
@@ -16,34 +16,65 @@ categories = Spree::Taxonomy.find_by!(name: I18n.t('spree.taxonomy_categories_na
|
|
16
16
|
categories_taxon = Spree::Taxon.where(name: I18n.t('spree.taxonomy_categories_name')).first_or_create!
|
17
17
|
|
18
18
|
TAXON_NAMES.each do |taxon_name|
|
19
|
-
taxon =
|
19
|
+
taxon =
|
20
|
+
if not categories_taxon.children.where(name: taxon_name).exists?
|
21
|
+
Spree::Taxon.create!(name: taxon_name, parent_id: categories_taxon.id, taxonomy: categories)
|
22
|
+
else
|
23
|
+
categories_taxon.children.where(name: taxon_name).first
|
24
|
+
end
|
20
25
|
taxon.taxonomy = categories
|
21
26
|
taxon.save!
|
22
27
|
end
|
23
28
|
|
24
29
|
CHILDREN_TAXON_NAMES.each do |(parent_name, taxon_name)|
|
25
30
|
parent = Spree::Taxon.where(name: parent_name).first
|
26
|
-
taxon =
|
31
|
+
taxon =
|
32
|
+
if parent.children.where(name: taxon_name).any?
|
33
|
+
parent.children.where(name: taxon_name).first
|
34
|
+
else
|
35
|
+
Spree::Taxon.create!(name: taxon_name, parent_id: parent.id, taxonomy: categories)
|
36
|
+
end
|
27
37
|
taxon.taxonomy = categories
|
28
38
|
taxon.save!
|
29
39
|
end
|
30
40
|
|
31
|
-
taxon =
|
41
|
+
taxon =
|
42
|
+
if categories_taxon.children.where(name: 'New').any?
|
43
|
+
categories_taxon.children.where(name: 'New').first
|
44
|
+
else
|
45
|
+
Spree::Taxon.create!(name: 'New', parent_id: categories_taxon.id, taxonomy: categories)
|
46
|
+
end
|
32
47
|
taxon.taxonomy = categories
|
33
48
|
taxon.save!
|
34
49
|
|
35
50
|
ADDITIONAL_TAXONS.each do |taxon_name|
|
36
|
-
taxon =
|
51
|
+
taxon =
|
52
|
+
if categories_taxon.children.where(name: taxon_name).any?
|
53
|
+
categories_taxon.children.where(name: taxon_name).first
|
54
|
+
else
|
55
|
+
Spree::Taxon.create!(name: taxon_name, parent_id: categories_taxon.id, taxonomy: categories)
|
56
|
+
end
|
37
57
|
taxon.taxonomy = categories
|
38
58
|
taxon.save!
|
39
59
|
end
|
40
60
|
|
41
61
|
SPECIAL_TAXONS.each do |parent_name, taxon_name|
|
42
|
-
parent =
|
62
|
+
parent =
|
63
|
+
if categories_taxon.children.where(name: parent_name.to_s).any?
|
64
|
+
categories_taxon.children.where(name: parent_name.to_s).first
|
65
|
+
else
|
66
|
+
Spree::Taxon.create!(name: parent_name.to_s, parent_id: categories_taxon.id, taxonomy: categories)
|
67
|
+
end
|
43
68
|
parent.taxonomy = categories
|
44
69
|
parent.save!
|
45
70
|
|
46
|
-
taxon =
|
71
|
+
taxon =
|
72
|
+
if parent.children.where(name: taxon_name).any?
|
73
|
+
parent.children.where(name: taxon_name).first
|
74
|
+
else
|
75
|
+
Spree::Taxon.create!(name: taxon_name, parent_id: parent.id, taxonomy: categories)
|
76
|
+
end
|
77
|
+
|
47
78
|
taxon.taxonomy = categories
|
48
79
|
taxon.save!
|
49
80
|
end
|
data/lib/spree_sample.rb
CHANGED
@@ -5,6 +5,7 @@ module SpreeSample
|
|
5
5
|
class Engine < Rails::Engine
|
6
6
|
engine_name 'spree_sample'
|
7
7
|
|
8
|
+
config.active_record.yaml_column_permitted_classes = [Symbol]
|
8
9
|
# Needs to be here so we can access it inside the tests
|
9
10
|
def self.load_samples
|
10
11
|
Spree::Sample.load_sample('addresses')
|
@@ -31,6 +32,7 @@ module SpreeSample
|
|
31
32
|
Spree::Sample.load_sample('reimbursements')
|
32
33
|
Spree::Sample.load_sample('return_authorization_reasons')
|
33
34
|
Spree::Sample.load_sample('stores')
|
35
|
+
Spree::Sample.load_sample('data_feeds')
|
34
36
|
|
35
37
|
Spree::Sample.load_sample('cms_standard_pages')
|
36
38
|
Spree::Sample.load_sample('cms_feature_pages')
|
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: 4.
|
4
|
+
version: 4.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-05-
|
12
|
+
date: 2023-05-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: spree_core
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 4.
|
20
|
+
version: 4.6.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 4.
|
27
|
+
version: 4.6.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: ffaker
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- db/samples/cms_homepages.rb
|
57
57
|
- db/samples/cms_sections.rb
|
58
58
|
- db/samples/cms_standard_pages.rb
|
59
|
+
- db/samples/data_feeds.rb
|
59
60
|
- db/samples/images/apache_baseball.png
|
60
61
|
- db/samples/images/ror_bag.jpeg
|
61
62
|
- db/samples/images/ror_baseball.jpeg
|
@@ -121,9 +122,9 @@ licenses:
|
|
121
122
|
- BSD-3-Clause
|
122
123
|
metadata:
|
123
124
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
124
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v4.
|
125
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v4.6.0
|
125
126
|
documentation_uri: https://dev-docs.spreecommerce.org/
|
126
|
-
source_code_uri: https://github.com/spree/spree/tree/v4.
|
127
|
+
source_code_uri: https://github.com/spree/spree/tree/v4.6.0
|
127
128
|
post_install_message:
|
128
129
|
rdoc_options: []
|
129
130
|
require_paths:
|