diff --git a/lib/spree/core.rb b/lib/spree/core.rb index a72bd8b5f8..5a7d98dbd2 100644 --- a/lib/spree/core.rb +++ b/lib/spree/core.rb @@ -35,7 +35,7 @@ module Spree # # This method is defined within the core gem on purpose. # Some people may only wish to use the Core part of Spree. - def self.config(&block) + def self.config yield(Spree::Config) end end diff --git a/lib/spree/core/calculated_adjustments.rb b/lib/spree/core/calculated_adjustments.rb index e735ec4993..c502c00099 100644 --- a/lib/spree/core/calculated_adjustments.rb +++ b/lib/spree/core/calculated_adjustments.rb @@ -65,15 +65,15 @@ module Spree calculator.compute(calculable) end - private - def self.model_name_without_spree_namespace to_s.tableize.gsub('/', '_').sub('spree_', '') end + private_class_method :model_name_without_spree_namespace def self.spree_calculators Rails.application.config.spree.calculators end + private_class_method :spree_calculators end end end diff --git a/lib/spree/core/delegate_belongs_to.rb b/lib/spree/core/delegate_belongs_to.rb index cf471ebb74..bfbf0b1fc0 100644 --- a/lib/spree/core/delegate_belongs_to.rb +++ b/lib/spree/core/delegate_belongs_to.rb @@ -91,4 +91,4 @@ module DelegateBelongsTo protected :delegator_for end -ActiveRecord::Base.__send__(:include, DelegateBelongsTo) +ActiveRecord::Base.include(DelegateBelongsTo) diff --git a/lib/spree/core/permalinks.rb b/lib/spree/core/permalinks.rb index 6dc1fb9c6a..b9d8a83274 100644 --- a/lib/spree/core/permalinks.rb +++ b/lib/spree/core/permalinks.rb @@ -71,5 +71,5 @@ module Spree end end -ActiveRecord::Base.__send__ :include, Spree::Core::Permalinks -ActiveRecord::Relation.__send__ :include, Spree::Core::Permalinks +ActiveRecord::Base.include(Spree::Core::Permalinks) +ActiveRecord::Relation.include(Spree::Core::Permalinks) diff --git a/lib/spree/i18n/initializer.rb b/lib/spree/i18n/initializer.rb index 85757681fe..64b649f708 100644 --- a/lib/spree/i18n/initializer.rb +++ b/lib/spree/i18n/initializer.rb @@ -1,3 +1,3 @@ # frozen_string_literal: true -Spree::BaseController.__send__(:include, Spree::ViewContext) +Spree::BaseController.include(Spree::ViewContext)