Module: Spree::CalculatedAdjustments

Extended by:
ActiveSupport::Concern
Included in:
Promotion::Actions::CreateAdjustment, Promotion::Actions::CreateItemAdjustments, ShippingMethod, TaxRate
Defined in:
app/models/concerns/spree/calculated_adjustments.rb

Instance Method Summary collapse

Instance Method Details

#calculator_typeObject



29
30
31
# File 'app/models/concerns/spree/calculated_adjustments.rb', line 29

def calculator_type
  calculator.class.to_s if calculator
end

#calculator_type=(calculator_type) ⇒ Object



33
34
35
36
# File 'app/models/concerns/spree/calculated_adjustments.rb', line 33

def calculator_type=(calculator_type)
  klass = calculator_type.constantize if calculator_type
  self.calculator = klass.new if klass && !calculator.is_a?(klass)
end