alchemy-solidus 8.1.0 → 8.3.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.
- checksums.yaml +4 -4
- data/Rakefile +2 -2
- data/app/jobs/alchemy/solidus/invalidate_elements_cache_job.rb +5 -0
- data/app/patches/models/alchemy/solidus/spree_product_patch.rb +2 -8
- data/app/patches/models/alchemy/solidus/spree_taxon_patch.rb +1 -10
- data/app/patches/models/alchemy/solidus/spree_variant_patch.rb +2 -10
- data/lib/alchemy/solidus/test_support/factories/ingredient_factories.rb +13 -0
- data/lib/alchemy/solidus/version.rb +1 -1
- 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: 5910186eafdfbac9b8a44de731612238d859f901d0089341ac05ce33dceba207
|
|
4
|
+
data.tar.gz: dc717567f6e7976a654dca88fe6c28064aa0483d51b4be509ad61d31ad60b59f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 242f2b28c334a3063733109a9f0f4881578e10e56050b25a6d9acc324136aefba7c06b2798de6616f4858a74f5906824f1a66c8cce79ff5990468e284f437f67
|
|
7
|
+
data.tar.gz: 7522e15e257a9763e6ab7c89053c7353816929e1674b50c641fe4e69fef373dae1db101fce7e3bff2bc01d540f41acf6a15f1a0e9f319ee6f7eec69abf27850d
|
data/Rakefile
CHANGED
|
@@ -14,9 +14,9 @@ task default: %i[test_setup spec]
|
|
|
14
14
|
|
|
15
15
|
desc "Setup test app"
|
|
16
16
|
task :test_setup do
|
|
17
|
-
solidus_branch = ENV.fetch("SOLIDUS_BRANCH", "v4.
|
|
17
|
+
solidus_branch = ENV.fetch("SOLIDUS_BRANCH", "v4.7")
|
|
18
18
|
solidus_install_options = "--payment-method=none --frontend=none --authentication=none"
|
|
19
|
-
if ["v4.5", "v4.6", "main"].include?(solidus_branch)
|
|
19
|
+
if ["v4.5", "v4.6", "v4.7", "main"].include?(solidus_branch)
|
|
20
20
|
solidus_install_options += " --admin-preview=false"
|
|
21
21
|
end
|
|
22
22
|
ENV["SKIP_SOLIDUS_BOLT"] = "1" # solidus_frontend defaults to installing solidus_bolt if auto-accept is used
|
|
@@ -4,6 +4,11 @@ module Alchemy
|
|
|
4
4
|
queue_as :default
|
|
5
5
|
|
|
6
6
|
def perform(model_name, id)
|
|
7
|
+
Alchemy::Deprecation.warn <<~WARN
|
|
8
|
+
Alchemy::Solidus::InvalidateElementsCacheJob is deprecated and will be removed in 9.0.
|
|
9
|
+
Please use Alchemy::InvalidateElementsCacheJob instead.
|
|
10
|
+
WARN
|
|
11
|
+
|
|
7
12
|
now = Time.current
|
|
8
13
|
|
|
9
14
|
element_ids = model(model_name)
|
|
@@ -4,8 +4,6 @@ module Alchemy
|
|
|
4
4
|
module Solidus
|
|
5
5
|
module SpreeProductPatch
|
|
6
6
|
def self.prepended(base)
|
|
7
|
-
# Solidus runs touch callbacks on product after_save
|
|
8
|
-
base.after_touch :touch_alchemy_ingredients
|
|
9
7
|
base.has_many :alchemy_ingredients, class_name: "Alchemy::Ingredients::SpreeProduct", as: :related_object, dependent: :nullify
|
|
10
8
|
end
|
|
11
9
|
|
|
@@ -24,13 +22,9 @@ module Alchemy
|
|
|
24
22
|
taxons.each(&:touch)
|
|
25
23
|
end
|
|
26
24
|
|
|
27
|
-
# Touch all elements that have this product assigned to one of its ingredients.
|
|
28
|
-
# This cascades to all parent elements and pages as well.
|
|
29
|
-
def touch_alchemy_ingredients
|
|
30
|
-
InvalidateElementsCacheJob.perform_later("SpreeProduct", id)
|
|
31
|
-
end
|
|
32
|
-
|
|
33
25
|
::Spree::Product.prepend self
|
|
34
26
|
end
|
|
35
27
|
end
|
|
28
|
+
|
|
29
|
+
::Spree::Product.include RelatableResource
|
|
36
30
|
end
|
|
@@ -4,20 +4,11 @@ module Alchemy
|
|
|
4
4
|
module Solidus
|
|
5
5
|
module SpreeTaxonPatch
|
|
6
6
|
def self.prepended(base)
|
|
7
|
-
base.after_update :touch_alchemy_ingredients
|
|
8
|
-
base.after_touch :touch_alchemy_ingredients
|
|
9
7
|
base.has_many :alchemy_ingredients, class_name: "Alchemy::Ingredients::SpreeTaxon", as: :related_object, dependent: :nullify
|
|
10
8
|
end
|
|
11
9
|
|
|
12
10
|
::Spree::Taxon.prepend self
|
|
13
|
-
|
|
14
|
-
private
|
|
15
|
-
|
|
16
|
-
# Touch all elements that have this taxon assigned to one of its ingredients.
|
|
17
|
-
# This cascades to all parent elements and pages as well.
|
|
18
|
-
def touch_alchemy_ingredients
|
|
19
|
-
InvalidateElementsCacheJob.perform_later("SpreeTaxon", id)
|
|
20
|
-
end
|
|
21
11
|
end
|
|
22
12
|
end
|
|
13
|
+
::Spree::Taxon.include RelatableResource
|
|
23
14
|
end
|
|
@@ -4,20 +4,12 @@ module Alchemy
|
|
|
4
4
|
module Solidus
|
|
5
5
|
module SpreeVariantPatch
|
|
6
6
|
def self.prepended(base)
|
|
7
|
-
base.after_update :touch_alchemy_ingredients
|
|
8
|
-
base.after_touch :touch_alchemy_ingredients
|
|
9
7
|
base.has_many :alchemy_ingredients, class_name: "Alchemy::Ingredients::SpreeVariant", as: :related_object, dependent: :nullify
|
|
10
8
|
end
|
|
11
9
|
|
|
12
10
|
::Spree::Variant.prepend self
|
|
13
|
-
|
|
14
|
-
private
|
|
15
|
-
|
|
16
|
-
# Touch all elements that have this variant assigned to one of its ingredients.
|
|
17
|
-
# This cascades to all parent elements and pages as well.
|
|
18
|
-
def touch_alchemy_ingredients
|
|
19
|
-
InvalidateElementsCacheJob.perform_later("SpreeVariant", id)
|
|
20
|
-
end
|
|
21
11
|
end
|
|
22
12
|
end
|
|
13
|
+
|
|
14
|
+
::Spree::Variant.include RelatableResource
|
|
23
15
|
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
FactoryBot.define do
|
|
2
|
+
%w[
|
|
3
|
+
product
|
|
4
|
+
taxon
|
|
5
|
+
variant
|
|
6
|
+
].each do |ingredient|
|
|
7
|
+
factory :"alchemy_ingredient_spree_#{ingredient}", class: "Alchemy::Ingredients::Spree#{ingredient.classify}" do
|
|
8
|
+
role { ingredient }
|
|
9
|
+
type { "Alchemy::Ingredients::Spree#{ingredient.classify}" }
|
|
10
|
+
association :element, name: ingredient, factory: :alchemy_element
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: alchemy-solidus
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 8.
|
|
4
|
+
version: 8.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Thomas von Deyen
|
|
@@ -15,7 +15,7 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 8.
|
|
18
|
+
version: 8.3.0
|
|
19
19
|
- - "<"
|
|
20
20
|
- !ruby/object:Gem::Version
|
|
21
21
|
version: '9'
|
|
@@ -25,7 +25,7 @@ dependencies:
|
|
|
25
25
|
requirements:
|
|
26
26
|
- - ">="
|
|
27
27
|
- !ruby/object:Gem::Version
|
|
28
|
-
version: 8.
|
|
28
|
+
version: 8.3.0
|
|
29
29
|
- - "<"
|
|
30
30
|
- !ruby/object:Gem::Version
|
|
31
31
|
version: '9'
|
|
@@ -241,14 +241,14 @@ dependencies:
|
|
|
241
241
|
requirements:
|
|
242
242
|
- - "~>"
|
|
243
243
|
- !ruby/object:Gem::Version
|
|
244
|
-
version: '
|
|
244
|
+
version: '8.0'
|
|
245
245
|
type: :development
|
|
246
246
|
prerelease: false
|
|
247
247
|
version_requirements: !ruby/object:Gem::Requirement
|
|
248
248
|
requirements:
|
|
249
249
|
- - "~>"
|
|
250
250
|
- !ruby/object:Gem::Version
|
|
251
|
-
version: '
|
|
251
|
+
version: '8.0'
|
|
252
252
|
description: A AlchemyCMS and Solidus integration
|
|
253
253
|
email:
|
|
254
254
|
- thomas@vondeyen.com
|
|
@@ -306,6 +306,7 @@ files:
|
|
|
306
306
|
- config/locales/en.yml
|
|
307
307
|
- lib/alchemy-solidus.rb
|
|
308
308
|
- lib/alchemy/solidus/engine.rb
|
|
309
|
+
- lib/alchemy/solidus/test_support/factories/ingredient_factories.rb
|
|
309
310
|
- lib/alchemy/solidus/version.rb
|
|
310
311
|
- lib/generators/alchemy/solidus/install/files/db/seeds/alchemy/pages.yml
|
|
311
312
|
- lib/generators/alchemy/solidus/install/install_generator.rb
|
|
@@ -329,7 +330,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
329
330
|
- !ruby/object:Gem::Version
|
|
330
331
|
version: '0'
|
|
331
332
|
requirements: []
|
|
332
|
-
rubygems_version: 4.0.
|
|
333
|
+
rubygems_version: 4.0.10
|
|
333
334
|
specification_version: 4
|
|
334
335
|
summary: The World's Most Flexible E-Commerce Platform meets The World's Most Flexible
|
|
335
336
|
Content Management System!
|