diff --git a/app/models/product.rb b/app/models/product.rb index b27a8cc5d..918e7c14b 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -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