Skip to content

Commit 3867232

Browse files
committed
Shipping Category: Add dependent: options
1 parent 13e4fae commit 3867232

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/app/models/spree/shipping_category.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ class ShippingCategory < Spree::Base
55
self.allowed_ransackable_attributes = %w[name]
66

77
validates :name, presence: true
8-
has_many :products, inverse_of: :shipping_category
9-
has_many :shipping_method_categories, inverse_of: :shipping_category
8+
has_many :products, inverse_of: :shipping_category, dependent: :restrict_with_error
9+
has_many :shipping_method_categories, inverse_of: :shipping_category, dependent: :destroy
1010
has_many :shipping_methods, through: :shipping_method_categories
1111
end
1212
end

0 commit comments

Comments
 (0)