1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-30 19:52:20 +01:00

(bug) fix cannot remove product if it has the relation with machines

This commit is contained in:
Du Peng 2022-10-11 16:40:45 +02:00
parent ef502070be
commit 7700737cf3

View File

@ -8,7 +8,7 @@ class Product < ApplicationRecord
belongs_to :product_category
has_many :machines_products, dependent: :destroy
has_many :machines_products, dependent: :delete_all
has_many :machines, through: :machines_products
has_many :product_files, as: :viewable, dependent: :destroy