From cf07a055d01d053329f23f9b5dfeeaccaf799ba4 Mon Sep 17 00:00:00 2001 From: Neal Chambers Date: Thu, 21 Sep 2023 23:24:48 +0900 Subject: [PATCH] Fix Rails/HasManyOrHasOneDependent with nil --- app/models/spree/shipping_method.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/spree/shipping_method.rb b/app/models/spree/shipping_method.rb index 1110892590..fea4601d9e 100644 --- a/app/models/spree/shipping_method.rb +++ b/app/models/spree/shipping_method.rb @@ -16,7 +16,7 @@ module Spree has_many :shipping_rates, inverse_of: :shipping_method, dependent: :destroy has_many :shipments, through: :shipping_rates has_many :shipping_method_categories, dependent: :destroy - has_many :shipping_categories, through: :shipping_method_categories, dependent: :destroy + has_many :shipping_categories, through: :shipping_method_categories, dependent: nil has_many :distributor_shipping_methods, dependent: :destroy has_many :distributors, through: :distributor_shipping_methods, class_name: 'Enterprise',