Skip to content

Commit

Permalink
Make Controller and Helper patches autoloadable
Browse files Browse the repository at this point in the history
  • Loading branch information
mamhoff committed Nov 21, 2024
1 parent 8b128dd commit 460808d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

module Alchemy
module Solidus
module AlchemyBaseControllerDecorator
def self.prepended(base)
base.include Spree::Core::ControllerHelpers::Auth
base.include Spree::Core::ControllerHelpers::Common
base.include Spree::Core::ControllerHelpers::Order
base.include Spree::Core::ControllerHelpers::PaymentParameters
base.include Spree::Core::ControllerHelpers::Pricing
base.include Spree::Core::ControllerHelpers::Search
base.include Spree::Core::ControllerHelpers::Store
base.include Spree::Core::ControllerHelpers::StrongParameters
end

if defined?(::Alchemy::BaseController)
::Alchemy::BaseController.prepend self
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

module Alchemy
module Solidus
module AlchemyBaseHelperDecorator
def self.prepended(base)
base.include Spree::BaseHelper
base.include Spree::CheckoutHelper
base.include Spree::ProductsHelper
base.include Spree::StoreHelper
base.include Spree::TaxonsHelper
end

if defined?(::Alchemy::BaseHelper)
::Alchemy::BaseHelper.prepend self
end
end
end
end
3 changes: 0 additions & 3 deletions lib/alchemy/solidus/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ class Engine < ::Rails::Engine
# See https://github.com/AlchemyCMS/alchemy_cms/issues/1626
ActionView::Base.prefix_partial_path_with_controller_namespace = false
end

# Allows to use Solidus helpers within Alchemys controller views
require_dependency "alchemy/solidus/use_solidus_layout"
end
end
end
Expand Down
19 changes: 0 additions & 19 deletions lib/alchemy/solidus/use_solidus_layout.rb

This file was deleted.

0 comments on commit 460808d

Please sign in to comment.