spree_sample 4.2.0.rc5 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/db/samples/stores.rb +16 -2
  3. metadata +8 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e132fb1cfcea92ddcb36a82445ce720214381371d945fa2dc985efe7fc99923d
4
- data.tar.gz: 568e65ae4a16d3e1bfd1819c1868a55a0ddd029ea6379b07d8359d509e50601d
3
+ metadata.gz: 5e39aabd186016f969279a92769acf2445cfdd47e11e2e23211b753d0232e7a1
4
+ data.tar.gz: 443b08ba7af99025b39b54ae96dcda06232b12b9497343264c98291a16399a06
5
5
  SHA512:
6
- metadata.gz: d95c3eb43ab419defdb3bdb206e770ce2087f4e1b24e49c7eb34171461a084f15e9609bd7a1261771b985a74337b4ffaad6723c48d12dfe2e2987cb9f8319212
7
- data.tar.gz: a3e143055088d3b450db6f18f67e6ca977cb2f941c13af4e775f08739989012776c26d515c5b86f975a0e757df0ce64e8e316c06085357d5c4f88d8e1f01c43e
6
+ metadata.gz: 4792c1caa7e192818c2519a39f98207f3effcec2dea899db92ddfc7a515d3e0ecbd195e4bdba03e3abb98df68feea1cf3f49994521e35ce4c2e904539af77d4a
7
+ data.tar.gz: dd1ab2a71bbd4f98d9e636904d0547b007ae0d8831f1d9783bbb72a530bae4ba1f42910bda3f95aefd80f96eb17f4c6ff326d748caa564d475e50317f5301f01
data/db/samples/stores.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  default_store = Spree::Store.default
2
2
  default_store.checkout_zone = Spree::Zone.find_by(name: 'North America')
3
3
  default_store.default_country = Spree::Country.default
4
+ default_store.supported_currencies = 'CAD,USD'
5
+ default_store.supported_locales = 'en,fr'
4
6
  default_store.url = Rails.env.development? ? 'localhost:3000' : 'demo.spreecommerce.org'
5
7
  default_store.save!
6
8
 
@@ -10,6 +12,7 @@ eu_store.url = Rails.env.development? ? 'eu.lvh.me:3000' : 'demo-eu.spreecommerc
10
12
  eu_store.mail_from_address = 'eustore@example.com'
11
13
  eu_store.default_currency = 'EUR'
12
14
  eu_store.default_locale = 'de'
15
+ eu_store.supported_locales = 'de,fr,es'
13
16
  eu_store.checkout_zone = Spree::Zone.find_by(name: 'EU_VAT')
14
17
  eu_store.default_country = Spree::Country.find_by(iso: 'DE')
15
18
  eu_store.save!
@@ -24,11 +27,15 @@ uk_store.checkout_zone = Spree::Zone.find_by(name: 'UK_VAT')
24
27
  uk_store.default_country = Spree::Country.find_by(iso: 'GB')
25
28
  uk_store.save!
26
29
 
27
- currencies = %w[EUR GBP]
30
+ currencies = %w[EUR GBP CAD]
28
31
  Spree::Price.where(currency: 'USD').each do |price|
29
32
  currencies.each do |currency|
30
33
  new_price = Spree::Price.find_or_initialize_by(currency: currency, variant: price.variant)
31
- new_price.amount = price.amount
34
+ new_price.amount = if %w[EUR GBP].include?(currency)
35
+ price.amount * 0.8
36
+ else
37
+ price.amount * 1.2
38
+ end
32
39
  new_price.save
33
40
  end
34
41
  end
@@ -36,3 +43,10 @@ end
36
43
  Spree::PaymentMethod.all.each do |payment_method|
37
44
  payment_method.stores = Spree::Store.all
38
45
  end
46
+
47
+ if defined?(Spree::StoreProduct) && Spree::Product.method_defined?(:stores)
48
+ Spree::Product.all.each do |product|
49
+ product.store_ids = Spree::Store.ids
50
+ product.save
51
+ end
52
+ end
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.2.0.rc5
4
+ version: 4.2.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: 2021-02-04 00:00:00.000000000 Z
12
+ date: 2021-02-25 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.2.0.rc5
20
+ version: 4.2.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.2.0.rc5
27
+ version: 4.2.0
28
28
  description: Required dependency for Spree
29
29
  email: hello@spreecommerce.org
30
30
  executables: []
@@ -101,9 +101,9 @@ licenses:
101
101
  - BSD-3-Clause
102
102
  metadata:
103
103
  bug_tracker_uri: https://github.com/spree/spree/issues
104
- changelog_uri: https://github.com/spree/spree/releases/tag/v4.2.0.rc5
104
+ changelog_uri: https://github.com/spree/spree/releases/tag/v4.2.0
105
105
  documentation_uri: https://guides.spreecommerce.org/
106
- source_code_uri: https://github.com/spree/spree/tree/v4.2.0.rc5
106
+ source_code_uri: https://github.com/spree/spree/tree/v4.2.0
107
107
  post_install_message:
108
108
  rdoc_options: []
109
109
  require_paths:
@@ -115,9 +115,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  requirements:
118
- - - ">"
118
+ - - ">="
119
119
  - !ruby/object:Gem::Version
120
- version: 1.3.1
120
+ version: '0'
121
121
  requirements:
122
122
  - none
123
123
  rubygems_version: 3.1.4