Change destroy to nullify

This commit is contained in:
Neal Chambers
2023-09-01 09:22:04 +09:00
parent 7c9bc58a4b
commit e22e08e666

View File

@@ -44,10 +44,10 @@ class Enterprise < ApplicationRecord
dependent: :destroy
has_many :supplied_variants, through: :supplied_products, source: :variants
has_many :distributed_orders, class_name: 'Spree::Order', foreign_key: 'distributor_id',
dependent: :destroy
dependent: :nullify
belongs_to :address, class_name: 'Spree::Address'
belongs_to :business_address, optional: true, class_name: 'Spree::Address', dependent: :destroy
has_many :enterprise_fees, dependent: :destroy
has_many :enterprise_fees, dependent: :nullify
has_many :enterprise_roles, dependent: :destroy
has_many :users, through: :enterprise_roles
belongs_to :owner, class_name: 'Spree::User',