We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13e4fae commit 3867232Copy full SHA for 3867232
core/app/models/spree/shipping_category.rb
@@ -5,8 +5,8 @@ class ShippingCategory < Spree::Base
5
self.allowed_ransackable_attributes = %w[name]
6
7
validates :name, presence: true
8
- has_many :products, inverse_of: :shipping_category
9
- has_many :shipping_method_categories, inverse_of: :shipping_category
+ has_many :products, inverse_of: :shipping_category, dependent: :restrict_with_error
+ has_many :shipping_method_categories, inverse_of: :shipping_category, dependent: :destroy
10
has_many :shipping_methods, through: :shipping_method_categories
11
end
12
0 commit comments