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.

Fixes ActionView::Template::Error (undefined method `_reflect_on_association' for Spree::Calculator:Class) (#11568)

François Koessler3062ff51222d
diff --git a/core/app/models/spree/calculator.rb b/core/app/models/spree/calculator.rb
index 1c3eefaa42..bf0da2275c 100644
--- a/core/app/models/spree/calculator.rb
+++ b/core/app/models/spree/calculator.rb
@@ -2,7 +2,7 @@ module Spree
class Calculator < Spree::Base
acts_as_paranoid
- belongs_to :calculable, polymorphic: true, optional: true
+ belongs_to :calculable, polymorphic: true, optional: true, inverse_of: :calculator
# This method calls a compute_<computable> method. must be overridden in concrete calculator.
#