Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fix Calculator to allow for one Calculator to be a subclass of another. (#11661)

Jan Berdajs0cccdc7283e6
diff --git a/core/app/models/concerns/spree/calculated_adjustments.rb b/core/app/models/concerns/spree/calculated_adjustments.rb
index 3c24b9a179..04aacb9ca2 100644
--- a/core/app/models/concerns/spree/calculated_adjustments.rb
+++ b/core/app/models/concerns/spree/calculated_adjustments.rb
@@ -18,7 +18,7 @@ module Spree
def calculator_type=(calculator_type)
klass = calculator_type.constantize if calculator_type
- self.calculator = klass.new if klass && !calculator.is_a?(klass)
+ self.calculator = klass.new if klass && !calculator.instance_of?(klass)
end
private