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.

Added missing inverse_of option

Damian Legawiec0a6973fd493a
diff --git a/core/app/models/spree/inventory_unit.rb b/core/app/models/spree/inventory_unit.rb
index 77d6ef0faa..ec292e8c2f 100644
--- a/core/app/models/spree/inventory_unit.rb
+++ b/core/app/models/spree/inventory_unit.rb
@@ -4,7 +4,7 @@ module Spree
belongs_to :variant, class_name: 'Spree::Variant'
belongs_to :order, class_name: 'Spree::Order'
belongs_to :shipment, class_name: 'Spree::Shipment', touch: true, optional: true
- has_many :return_items
+ has_many :return_items, inverse_of: :inventory_unit
has_many :return_authorizations, class_name: 'Spree::ReturnAuthorization', through: :return_items
belongs_to :line_item, class_name: 'Spree::LineItem'
end