alchemy-solidus 7.6.0 → 7.7.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 (31) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -26
  3. data/app/jobs/alchemy/solidus/base_job.rb +7 -0
  4. data/app/jobs/alchemy/solidus/invalidate_elements_cache_job.rb +39 -0
  5. data/app/patches/controllers/alchemy/solidus/alchemy_base_controller_patch.rb +22 -0
  6. data/app/patches/controllers/alchemy/solidus/application_controller_patch.rb +19 -0
  7. data/app/patches/controllers/alchemy/solidus/spree_user_confirmations_controller_patch.rb +15 -0
  8. data/app/patches/controllers/alchemy/solidus/spree_user_passwords_controller_patch.rb +15 -0
  9. data/app/patches/controllers/alchemy/solidus/spree_user_registrations_controller_patch.rb +15 -0
  10. data/app/patches/controllers/alchemy/solidus/spree_user_sessions_controller_patch.rb +15 -0
  11. data/app/patches/helpers/alchemy/solidus/alchemy_base_helper_patch.rb +19 -0
  12. data/{lib/alchemy/solidus/alchemy_user_extension.rb → app/patches/models/alchemy/solidus/alchemy_user_patch.rb} +6 -2
  13. data/app/{decorators/models/alchemy/solidus/spree_product_decorator.rb → patches/models/alchemy/solidus/spree_product_patch.rb} +9 -2
  14. data/app/patches/models/alchemy/solidus/spree_taxon_patch.rb +23 -0
  15. data/{lib/alchemy/solidus/spree_user_extension.rb → app/patches/models/alchemy/solidus/spree_user_patch.rb} +9 -3
  16. data/app/patches/models/alchemy/solidus/spree_variant_patch.rb +23 -0
  17. data/lib/alchemy/solidus/engine.rb +17 -16
  18. data/lib/alchemy/solidus/version.rb +1 -1
  19. data/lib/patches/backend/controllers/alchemy/solidus/spree_admin_base_controller_patch.rb +25 -0
  20. data/lib/patches/frontend/controllers/alchemy/solidus/spree_store_controller_patch.rb +17 -0
  21. metadata +21 -18
  22. data/app/decorators/models/alchemy/solidus/spree_taxon_decorator.rb +0 -14
  23. data/app/decorators/models/alchemy/solidus/spree_variant_decorator.rb +0 -14
  24. data/app/models/alchemy/solidus/touch_alchemy_ingredients.rb +0 -20
  25. data/db/migrate/20120229160509_create_alchemy_essence_spree_products.rb +0 -8
  26. data/db/migrate/20131030140218_create_alchemy_essence_spree_taxons.rb +0 -10
  27. data/db/migrate/20191107135822_create_alchemy_essence_spree_variants.rb +0 -9
  28. data/lib/alchemy/solidus/alchemy_in_solidus.rb +0 -17
  29. data/lib/alchemy/solidus/current_user_helpers.rb +0 -9
  30. data/lib/alchemy/solidus/spree_admin_unauthorized_redirect.rb +0 -9
  31. data/lib/alchemy/solidus/use_solidus_layout.rb +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15dc076bf68bd7b1c707371eb37043cce0118953337e4cb83a4d3b618986c96f
4
- data.tar.gz: b4d750ba90f8e34ca84116c92fe644a286f2d7dbb3ce27e856ecef9b292e3f0d
3
+ metadata.gz: 143befa0b406d415141a772a96b1b8203914f8826ba3bfeab814753525ce9808
4
+ data.tar.gz: ebd5ffbb9ecc0049e43b15e7a685eb7fe0fb729f54702ced9448827811ef02c5
5
5
  SHA512:
6
- metadata.gz: 33b5b8f176dbf5db6047537a149b55048956f5732bd0c63b47e2b67de6a0949240d8d62786288bc76f9ddd69bfad544c7c4509017d176c8891654958480389e1
7
- data.tar.gz: 1fe4a15e0c4da77036c0df1e6adbe2c68fa8d6f5e0adcb5d56f4602b0c6156beb870fcfabb9ec1f71a7d3cb19b91b52aa10f6d738fff45ccd43b95831e88d083
6
+ metadata.gz: e2d5614f2d2279cdd6905bfeef1e396d6d9b4e4913aeb843527f1e0c678dcfde1094e5a9dae7ea7c80d96883999bae0a12e83dcbf85b84d52a36b667d3e179da
7
+ data.tar.gz: 23cab9eee9c6ceb74acf1510edf65386ab57c931c3d0cb226b02c6b37a9bd41c9e104525a75da01431b380d7e7a2290dca1a9b4b7cdce45ab662325814ebb8a9
data/README.md CHANGED
@@ -194,32 +194,6 @@ $ bundle exec rake alchemy:install
194
194
 
195
195
  and follow the on screen instructions.
196
196
 
197
- ### Render Alchemy Content in Solidus Layout
198
-
199
- ~~If you plan to render the Alchemy site in the Solidus layout add the following
200
- to your initializer:~~
201
-
202
- ```ruby
203
- # config/initializers/alchemy.rb
204
- require 'alchemy/solidus/use_solidus_layout'
205
- ```
206
-
207
- **NOTE:** Since v2.5.2 this is done automatically for you. If you upgraded from an older version you can safely remove this from your initializers.
208
-
209
- ### Render Alchemy Content in Solidus views
210
-
211
- ~~If you plan to render Alchemy content in your Solidus views (ie. a global header
212
- or footer section), you need to include the Alchemy view helpers and language
213
- store in your Solidus controllers with the following addition to your
214
- initializer:~~
215
-
216
- ```ruby
217
- # config/initializers/alchemy.rb
218
- require 'alchemy/solidus/alchemy_in_solidus'
219
- ```
220
-
221
- **NOTE:** Since v2.5.2 this is done automatically for you. If you upgraded from an older version you can safely remove this from your initializers.
222
-
223
197
  ### Routing
224
198
 
225
199
  For routing you have a few options.
@@ -0,0 +1,7 @@
1
+ module Alchemy
2
+ module Solidus
3
+ class BaseJob < ActiveJob::Base
4
+ retry_on ActiveRecord::Deadlocked
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,39 @@
1
+ module Alchemy
2
+ module Solidus
3
+ class InvalidateElementsCacheJob < BaseJob
4
+ queue_as :default
5
+
6
+ def perform(model_name, id)
7
+ now = Time.current
8
+
9
+ element_ids = model(model_name)
10
+ .where(related_object_id: id)
11
+ .joins(:element)
12
+ .pluck("alchemy_elements.id")
13
+ elements = ::Alchemy::Element.where(id: element_ids)
14
+
15
+ all_element_ids = get_all_element_ids(elements, element_ids)
16
+ ::Alchemy::Element.where(id: all_element_ids.uniq).update_all(updated_at: now)
17
+
18
+ page_ids = elements.joins(page_version: :page).pluck("alchemy_pages.id")
19
+ ::Alchemy::Page.where(id: page_ids.uniq).update_all(updated_at: now)
20
+ end
21
+
22
+ private
23
+
24
+ def get_all_element_ids(elements, element_ids)
25
+ parent_element_ids = elements.pluck(:parent_element_id).compact
26
+ parent_elements = ::Alchemy::Element.distinct.where(id: parent_element_ids)
27
+
28
+ if parent_elements.any?
29
+ element_ids += parent_element_ids
30
+ get_all_element_ids(parent_elements, element_ids)
31
+ else
32
+ element_ids
33
+ end
34
+ end
35
+
36
+ def model(model_name) = "Alchemy::Ingredients::#{model_name}".constantize
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alchemy
4
+ module Solidus
5
+ module AlchemyBaseControllerPatch
6
+ def self.prepended(base)
7
+ base.include Spree::Core::ControllerHelpers::Auth
8
+ base.include Spree::Core::ControllerHelpers::Common
9
+ base.include Spree::Core::ControllerHelpers::Order
10
+ base.include Spree::Core::ControllerHelpers::PaymentParameters
11
+ base.include Spree::Core::ControllerHelpers::Pricing
12
+ base.include Spree::Core::ControllerHelpers::Search
13
+ base.include Spree::Core::ControllerHelpers::Store
14
+ base.include Spree::Core::ControllerHelpers::StrongParameters
15
+ end
16
+
17
+ if defined?(::Alchemy::BaseController)
18
+ ::Alchemy::BaseController.prepend self
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alchemy
4
+ module Solidus
5
+ module ApplicationControllerPatch
6
+ def spree_current_user
7
+ if Alchemy.user_class_name == "::Alchemy::User"
8
+ current_user
9
+ else
10
+ super
11
+ end
12
+ end
13
+
14
+ if defined?(::ApplicationController)
15
+ ::ApplicationController.prepend self
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alchemy
4
+ module Solidus
5
+ module SpreeUserConfirmationsControllerPatch
6
+ def self.prepended(base)
7
+ base.include Alchemy::ControllerActions
8
+ end
9
+
10
+ if defined?(::Spree::UserConfirmationsController)
11
+ ::Spree::UserConfirmationsController.prepend self
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alchemy
4
+ module Solidus
5
+ module SpreeUserPasswordsControllerPatch
6
+ def self.prepended(base)
7
+ base.include Alchemy::ControllerActions
8
+ end
9
+
10
+ if defined?(::Spree::UserPasswordsController)
11
+ ::Spree::UserPasswordsController.prepend self
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alchemy
4
+ module Solidus
5
+ module SpreeUserRegistrationsControllerPatch
6
+ def self.prepended(base)
7
+ base.include Alchemy::ControllerActions
8
+ end
9
+
10
+ if defined?(::Spree::UserRegistrationsController)
11
+ ::Spree::UserRegistrationsController.prepend self
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alchemy
4
+ module Solidus
5
+ module SpreeUserSessionsControllerPatch
6
+ def self.prepended(base)
7
+ base.include Alchemy::ControllerActions
8
+ end
9
+
10
+ if defined?(::Spree::UserSessionsController)
11
+ ::Spree::UserSessionsController.prepend self
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alchemy
4
+ module Solidus
5
+ module AlchemyBaseHelperPatch
6
+ def self.prepended(base)
7
+ base.include Spree::BaseHelper
8
+ base.include Spree::CheckoutHelper
9
+ base.include Spree::ProductsHelper
10
+ base.include Spree::StoreHelper
11
+ base.include Spree::TaxonsHelper
12
+ end
13
+
14
+ if defined?(::Alchemy::BaseHelper)
15
+ ::Alchemy::BaseHelper.prepend self
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,7 +1,7 @@
1
1
  module Alchemy
2
2
  module Solidus
3
- module AlchemyUserExtension
4
- def self.included(klass)
3
+ module AlchemyUserPatch
4
+ def self.prepended(klass)
5
5
  klass.include Spree::UserMethods
6
6
  end
7
7
 
@@ -12,6 +12,10 @@ module Alchemy
12
12
  ::Spree::Role.none
13
13
  end
14
14
  end
15
+
16
+ if defined?(::Alchemy::User)
17
+ ::Alchemy::User.prepend self
18
+ end
15
19
  end
16
20
  end
17
21
  end
@@ -2,9 +2,10 @@
2
2
 
3
3
  module Alchemy
4
4
  module Solidus
5
- module SpreeProductDecorator
5
+ module SpreeProductPatch
6
6
  def self.prepended(base)
7
- base.include Alchemy::Solidus::TouchAlchemyIngredients
7
+ # Solidus runs touch callbacks on product after_save
8
+ base.after_touch :touch_alchemy_ingredients
8
9
  base.has_many :alchemy_ingredients, class_name: "Alchemy::Ingredients::SpreeProduct", as: :related_object, dependent: :nullify
9
10
  end
10
11
 
@@ -23,6 +24,12 @@ module Alchemy
23
24
  taxons.each(&:touch)
24
25
  end
25
26
 
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
+
26
33
  ::Spree::Product.prepend self
27
34
  end
28
35
  end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alchemy
4
+ module Solidus
5
+ module SpreeTaxonPatch
6
+ def self.prepended(base)
7
+ base.after_update :touch_alchemy_ingredients
8
+ base.after_touch :touch_alchemy_ingredients
9
+ base.has_many :alchemy_ingredients, class_name: "Alchemy::Ingredients::SpreeTaxon", as: :related_object, dependent: :nullify
10
+ end
11
+
12
+ ::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
+ end
22
+ end
23
+ end
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  module Solidus
3
- module SpreeUserExtension
4
- def self.included(klass)
5
- klass.has_many :folded_pages, class_name: "Alchemy::FoldedPage"
5
+ module SpreeUserPatch
6
+ def self.prepended(base)
7
+ base.has_many :folded_pages, class_name: "Alchemy::FoldedPage"
6
8
  end
7
9
 
8
10
  def alchemy_display_name
@@ -16,6 +18,10 @@ module Alchemy
16
18
  []
17
19
  end
18
20
  end
21
+
22
+ if defined?(::Spree::User)
23
+ ::Spree::User.prepend self
24
+ end
19
25
  end
20
26
  end
21
27
  end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alchemy
4
+ module Solidus
5
+ module SpreeVariantPatch
6
+ def self.prepended(base)
7
+ base.after_update :touch_alchemy_ingredients
8
+ base.after_touch :touch_alchemy_ingredients
9
+ base.has_many :alchemy_ingredients, class_name: "Alchemy::Ingredients::SpreeVariant", as: :related_object, dependent: :nullify
10
+ end
11
+
12
+ ::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
+ end
22
+ end
23
+ end
@@ -4,6 +4,12 @@ require "solidus_core"
4
4
  require "solidus_backend"
5
5
  require "solidus_support"
6
6
 
7
+ begin
8
+ require "solidus_frontend"
9
+ rescue LoadError
10
+ # Solidus frontend is not available, but we can still load the engine
11
+ end
12
+
7
13
  module Alchemy
8
14
  module Solidus
9
15
  class Engine < ::Rails::Engine
@@ -25,26 +31,21 @@ module Alchemy
25
31
  Alchemy.register_ability ::Spree::Ability
26
32
  ::Spree::Ability.register_ability ::Alchemy::Permissions
27
33
 
28
- if Alchemy.user_class_name == "::Spree::User"
29
- require "alchemy/solidus/spree_user_extension"
30
- Spree::User.include Alchemy::Solidus::SpreeUserExtension
31
- end
32
-
33
- if Alchemy.user_class_name == "::Alchemy::User"
34
- require "alchemy/solidus/alchemy_user_extension"
35
- require "alchemy/solidus/current_user_helpers"
36
- Alchemy::User.include Alchemy::Solidus::AlchemyUserExtension
37
- ApplicationController.include Alchemy::Solidus::CurrentUserHelpers
38
- require "alchemy/solidus/spree_admin_unauthorized_redirect"
39
- end
40
-
41
34
  if SolidusSupport.frontend_available?
42
35
  # Allows to render Alchemy content within Solidus' controller views
43
- require_dependency "alchemy/solidus/alchemy_in_solidus"
36
+
37
+ # Do not prefix element view partials with `spree` namespace.
38
+ # See https://github.com/AlchemyCMS/alchemy_cms/issues/1626
39
+ ActionView::Base.prefix_partial_path_with_controller_namespace = false
44
40
  end
41
+ end
45
42
 
46
- # Allows to use Solidus helpers within Alchemys controller views
47
- require_dependency "alchemy/solidus/use_solidus_layout"
43
+ initializer "alchemy_solidus.patches" do |app|
44
+ if Alchemy.gem_version < Gem::Version.new("7.4.0") && SolidusSupport.backend_available?
45
+ app.config.to_prepare do
46
+ Alchemy::Solidus::SpreeAdminBaseControllerPatch
47
+ end
48
+ end
48
49
  end
49
50
  end
50
51
  end
@@ -1,5 +1,5 @@
1
1
  module Alchemy
2
2
  module Solidus
3
- VERSION = "7.6.0"
3
+ VERSION = "7.7.0"
4
4
  end
5
5
  end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alchemy
4
+ module Solidus
5
+ module SpreeAdminBaseControllerPatch
6
+ def self.prepended(base)
7
+ if Alchemy.user_class_name == "::Alchemy::User"
8
+ base.unauthorized_redirect = -> do
9
+ if spree_current_user
10
+ flash[:error] = I18n.t("spree.authorization_failure")
11
+ redirect_to spree.root_path
12
+ else
13
+ store_location
14
+ redirect_to Alchemy.login_path
15
+ end
16
+ end
17
+ end
18
+ end
19
+
20
+ if defined?(::Spree::Admin::BaseController)
21
+ ::Spree::Admin::BaseController.prepend self
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alchemy
4
+ module Solidus
5
+ module SpreeStoreControllerPatch
6
+ # Allows to render Alchemy content within Solidus' controller views
7
+ def self.prepended(base)
8
+ base.include Alchemy::ControllerActions
9
+ base.include Alchemy::ConfigurationMethods
10
+ end
11
+
12
+ if defined?(::Spree::StoreController)
13
+ ::Spree::StoreController.prepend self
14
+ end
15
+ end
16
+ end
17
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy-solidus
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.6.0
4
+ version: 7.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-04-08 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: alchemy_cms
@@ -75,7 +75,7 @@ dependencies:
75
75
  requirements:
76
76
  - - ">="
77
77
  - !ruby/object:Gem::Version
78
- version: 0.1.1
78
+ version: 0.14.0
79
79
  - - "<"
80
80
  - !ruby/object:Gem::Version
81
81
  version: '1'
@@ -85,7 +85,7 @@ dependencies:
85
85
  requirements:
86
86
  - - ">="
87
87
  - !ruby/object:Gem::Version
88
- version: 0.1.1
88
+ version: 0.14.0
89
89
  - - "<"
90
90
  - !ruby/object:Gem::Version
91
91
  version: '1'
@@ -248,22 +248,32 @@ files:
248
248
  - app/components/alchemy/ingredients/spree_product_view.rb
249
249
  - app/components/alchemy/ingredients/spree_taxon_view.rb
250
250
  - app/components/alchemy/ingredients/spree_variant_view.rb
251
- - app/decorators/models/alchemy/solidus/spree_product_decorator.rb
252
- - app/decorators/models/alchemy/solidus/spree_taxon_decorator.rb
253
- - app/decorators/models/alchemy/solidus/spree_variant_decorator.rb
254
251
  - app/javascript/alchemy_solidus.js
255
252
  - app/javascript/alchemy_solidus/components/ajax_config.js
256
253
  - app/javascript/alchemy_solidus/components/product_select.js
257
254
  - app/javascript/alchemy_solidus/components/taxon_select.js
258
255
  - app/javascript/alchemy_solidus/components/variant_select.js
256
+ - app/jobs/alchemy/solidus/base_job.rb
257
+ - app/jobs/alchemy/solidus/invalidate_elements_cache_job.rb
259
258
  - app/models/alchemy/ingredients/spree_product.rb
260
259
  - app/models/alchemy/ingredients/spree_taxon.rb
261
260
  - app/models/alchemy/ingredients/spree_variant.rb
262
- - app/models/alchemy/solidus/touch_alchemy_ingredients.rb
263
261
  - app/overrides/alchemy/admin/pages/link/product_link.html.erb.deface
264
262
  - app/overrides/alchemy/admin/pages/link/product_link_panel.html.erb.deface
265
263
  - app/overrides/alchemy/admin/pages/link/product_link_sl_tab.html.erb.deface
266
264
  - app/overrides/alchemy/admin/pages/link/product_link_tab.html.erb.deface
265
+ - app/patches/controllers/alchemy/solidus/alchemy_base_controller_patch.rb
266
+ - app/patches/controllers/alchemy/solidus/application_controller_patch.rb
267
+ - app/patches/controllers/alchemy/solidus/spree_user_confirmations_controller_patch.rb
268
+ - app/patches/controllers/alchemy/solidus/spree_user_passwords_controller_patch.rb
269
+ - app/patches/controllers/alchemy/solidus/spree_user_registrations_controller_patch.rb
270
+ - app/patches/controllers/alchemy/solidus/spree_user_sessions_controller_patch.rb
271
+ - app/patches/helpers/alchemy/solidus/alchemy_base_helper_patch.rb
272
+ - app/patches/models/alchemy/solidus/alchemy_user_patch.rb
273
+ - app/patches/models/alchemy/solidus/spree_product_patch.rb
274
+ - app/patches/models/alchemy/solidus/spree_taxon_patch.rb
275
+ - app/patches/models/alchemy/solidus/spree_user_patch.rb
276
+ - app/patches/models/alchemy/solidus/spree_variant_patch.rb
267
277
  - app/views/alchemy/ingredients/_spree_product_editor.html.erb
268
278
  - app/views/alchemy/ingredients/_spree_product_view.html.erb
269
279
  - app/views/alchemy/ingredients/_spree_taxon_editor.html.erb
@@ -278,20 +288,13 @@ files:
278
288
  - config/locales/alchemy_solidus_en.yml
279
289
  - config/locales/alchemy_solidus_it.yml
280
290
  - config/locales/en.yml
281
- - db/migrate/20120229160509_create_alchemy_essence_spree_products.rb
282
- - db/migrate/20131030140218_create_alchemy_essence_spree_taxons.rb
283
- - db/migrate/20191107135822_create_alchemy_essence_spree_variants.rb
284
291
  - lib/alchemy-solidus.rb
285
- - lib/alchemy/solidus/alchemy_in_solidus.rb
286
- - lib/alchemy/solidus/alchemy_user_extension.rb
287
- - lib/alchemy/solidus/current_user_helpers.rb
288
292
  - lib/alchemy/solidus/engine.rb
289
- - lib/alchemy/solidus/spree_admin_unauthorized_redirect.rb
290
- - lib/alchemy/solidus/spree_user_extension.rb
291
- - lib/alchemy/solidus/use_solidus_layout.rb
292
293
  - lib/alchemy/solidus/version.rb
293
294
  - lib/generators/alchemy/solidus/install/files/db/seeds/alchemy/pages.yml
294
295
  - lib/generators/alchemy/solidus/install/install_generator.rb
296
+ - lib/patches/backend/controllers/alchemy/solidus/spree_admin_base_controller_patch.rb
297
+ - lib/patches/frontend/controllers/alchemy/solidus/spree_store_controller_patch.rb
295
298
  homepage: https://github.com/AlchemyCMS/alchemy-solidus
296
299
  licenses:
297
300
  - BSD-3-Clause
@@ -310,7 +313,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
310
313
  - !ruby/object:Gem::Version
311
314
  version: '0'
312
315
  requirements: []
313
- rubygems_version: 3.6.5
316
+ rubygems_version: 3.6.7
314
317
  specification_version: 4
315
318
  summary: The World's Most Flexible E-Commerce Platform meets The World's Most Flexible
316
319
  Content Management System!
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Alchemy
4
- module Solidus
5
- module SpreeTaxonDecorator
6
- def self.prepended(base)
7
- base.include Alchemy::Solidus::TouchAlchemyIngredients
8
- base.has_many :alchemy_ingredients, class_name: "Alchemy::Ingredients::SpreeTaxon", as: :related_object, dependent: :nullify
9
- end
10
-
11
- ::Spree::Taxon.prepend self
12
- end
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Alchemy
4
- module Solidus
5
- module SpreeVariantDecorator
6
- def self.prepended(base)
7
- base.include Alchemy::Solidus::TouchAlchemyIngredients
8
- base.has_many :alchemy_ingredients, class_name: "Alchemy::Ingredients::SpreeVariant", as: :related_object, dependent: :nullify
9
- end
10
-
11
- ::Spree::Variant.prepend self
12
- end
13
- end
14
- end
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Alchemy
4
- module Solidus
5
- module TouchAlchemyIngredients
6
- extend ActiveSupport::Concern
7
-
8
- included do
9
- after_update :touch_alchemy_ingredients
10
- after_touch :touch_alchemy_ingredients
11
- end
12
-
13
- private
14
-
15
- def touch_alchemy_ingredients
16
- alchemy_ingredients.each(&:touch)
17
- end
18
- end
19
- end
20
- end
@@ -1,8 +0,0 @@
1
- class CreateAlchemyEssenceSpreeProducts < ActiveRecord::Migration[4.2]
2
- def change
3
- create_table "alchemy_essence_spree_products" do |t|
4
- t.integer :spree_product_id
5
- end
6
- add_index :alchemy_essence_spree_products, :spree_product_id
7
- end
8
- end
@@ -1,10 +0,0 @@
1
- class CreateAlchemyEssenceSpreeTaxons < ActiveRecord::Migration[4.2]
2
- def change
3
- create_table :alchemy_essence_spree_taxons do |t|
4
- t.references :taxon
5
-
6
- t.timestamps
7
- end
8
- add_index :alchemy_essence_spree_taxons, :taxon_id
9
- end
10
- end
@@ -1,9 +0,0 @@
1
- class CreateAlchemyEssenceSpreeVariants < ActiveRecord::Migration[5.2]
2
- def change
3
- create_table :alchemy_essence_spree_variants do |t|
4
- t.references :variant, null: true, foreign_key: {to_table: Spree::Variant.table_name}
5
-
6
- t.timestamps
7
- end
8
- end
9
- end
@@ -1,17 +0,0 @@
1
- # Allows to render Alchemy content within Solidus' controller views
2
- Spree::StoreController.include(
3
- Alchemy::ControllerActions,
4
- Alchemy::ConfigurationMethods
5
- )
6
-
7
- # Hook into SolidusAuthDevise controllers if present
8
- if defined? Spree::Auth::Engine
9
- Spree::UserPasswordsController.include Alchemy::ControllerActions
10
- Spree::UserConfirmationsController.include Alchemy::ControllerActions
11
- Spree::UserRegistrationsController.include Alchemy::ControllerActions
12
- Spree::UserSessionsController.include Alchemy::ControllerActions
13
- end
14
-
15
- # Do not prefix element view partials with `spree` namespace.
16
- # See https://github.com/AlchemyCMS/alchemy_cms/issues/1626
17
- ActionView::Base.prefix_partial_path_with_controller_namespace = false
@@ -1,9 +0,0 @@
1
- module Alchemy
2
- module Solidus
3
- module CurrentUserHelpers
4
- def spree_current_user
5
- current_user
6
- end
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- Spree::Admin::BaseController.unauthorized_redirect = -> do
2
- if spree_current_user
3
- flash[:error] = I18n.t("spree.authorization_failure")
4
- redirect_to spree.root_path
5
- else
6
- store_location
7
- redirect_to Alchemy.login_path
8
- end
9
- end
@@ -1,19 +0,0 @@
1
- # Allows to use Solidus helpers within Alchemys controller views
2
- Alchemy::BaseHelper.include(
3
- Spree::BaseHelper,
4
- Spree::CheckoutHelper,
5
- Spree::ProductsHelper,
6
- Spree::StoreHelper,
7
- Spree::TaxonsHelper
8
- )
9
-
10
- Alchemy::BaseController.include(
11
- Spree::Core::ControllerHelpers::Auth,
12
- Spree::Core::ControllerHelpers::Common,
13
- Spree::Core::ControllerHelpers::Order,
14
- Spree::Core::ControllerHelpers::PaymentParameters,
15
- Spree::Core::ControllerHelpers::Pricing,
16
- Spree::Core::ControllerHelpers::Search,
17
- Spree::Core::ControllerHelpers::Store,
18
- Spree::Core::ControllerHelpers::StrongParameters
19
- )