mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Merge pull request #7947 from andrewpbrett/zeitwerk
Use zeitwerk for autoloading
This commit is contained in:
@@ -11,8 +11,6 @@
|
||||
# and copy all the definitions allowing the subclass to add
|
||||
# additional defintions without affecting the base
|
||||
|
||||
require 'spree/preferences/store'
|
||||
|
||||
module Spree
|
||||
module Preferences
|
||||
module Preferable
|
||||
|
||||
@@ -89,7 +89,8 @@ module Openfoodnetwork
|
||||
end
|
||||
|
||||
# Register Spree calculators
|
||||
initializer 'spree.register.calculators' do |app|
|
||||
Rails.application.reloader.to_prepare do
|
||||
app = Openfoodnetwork::Application
|
||||
app.config.spree.calculators.shipping_methods = [
|
||||
Calculator::FlatPercentItemTotal,
|
||||
Calculator::FlatRate,
|
||||
@@ -100,7 +101,7 @@ module Openfoodnetwork
|
||||
]
|
||||
|
||||
app.config.spree.calculators.add_class('enterprise_fees')
|
||||
config.spree.calculators.enterprise_fees = [
|
||||
app.config.spree.calculators.enterprise_fees = [
|
||||
Calculator::FlatPercentPerItem,
|
||||
Calculator::FlatRate,
|
||||
Calculator::FlexiRate,
|
||||
@@ -110,7 +111,7 @@ module Openfoodnetwork
|
||||
]
|
||||
|
||||
app.config.spree.calculators.add_class('payment_methods')
|
||||
config.spree.calculators.payment_methods = [
|
||||
app.config.spree.calculators.payment_methods = [
|
||||
Calculator::FlatPercentItemTotal,
|
||||
Calculator::FlatRate,
|
||||
Calculator::FlexiRate,
|
||||
@@ -119,7 +120,7 @@ module Openfoodnetwork
|
||||
]
|
||||
|
||||
app.config.spree.calculators.add_class('tax_rates')
|
||||
config.spree.calculators.tax_rates = [
|
||||
app.config.spree.calculators.tax_rates = [
|
||||
Calculator::DefaultTax
|
||||
]
|
||||
end
|
||||
@@ -205,5 +206,7 @@ module Openfoodnetwork
|
||||
config.action_controller.include_all_helpers = false
|
||||
|
||||
config.generators.template_engine = :haml
|
||||
|
||||
config.autoloader = :zeitwerk
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,3 +8,8 @@
|
||||
# inflect.irregular 'person', 'people'
|
||||
# inflect.uncountable %w( fish sheep )
|
||||
# end
|
||||
Rails.autoloaders.each do |autoloader|
|
||||
autoloader.inflector.inflect(
|
||||
"stripe_sca" => "StripeSCA"
|
||||
)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user