Skip to content

Commit

Permalink
Remove Spree::*.calculators method
Browse files Browse the repository at this point in the history
Class method `calculators` on Spree::CalculatedAdjustments has removed
in favour of Rails.application.config.spree.calculators.

The classes affected are:
Spree::ShippingMethod
Spree::TaxRate
Spree::Promotion::Actions::CreateAdjustment
Spree::Promotion::Actions::CreateItemAdjustment
  • Loading branch information
DanielePalombo committed Oct 30, 2020
1 parent 9996c3d commit cf293a6
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions core/app/models/concerns/spree/calculated_adjustments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,6 @@ module CalculatedAdjustments
validates :calculator, presence: true
end

class_methods do
def calculators
Spree::Deprecation.warn("Calling .calculators is deprecated. Please access through Rails.application.config.spree.calculators")

spree_calculators.send model_name_without_spree_namespace
end

private

def model_name_without_spree_namespace
to_s.tableize.tr('/', '_').sub('spree_', '')
end

def spree_calculators
Spree::Config.environment.calculators
end
end

def calculator_type
calculator.class.to_s if calculator
end
Expand Down

0 comments on commit cf293a6

Please sign in to comment.