diff --git a/app/models/m_odr_file.rb b/app/models/m_odr_file.rb index 039a88a..3b6ca0d 100644 --- a/app/models/m_odr_file.rb +++ b/app/models/m_odr_file.rb @@ -12,6 +12,8 @@ class MOdrFile < ApplicationRecord has_many :m_odr_file_products, :dependent => :destroy accepts_nested_attributes_for :m_odr_file_products, :allow_destroy => true + validates_associated :m_odr_file_products + has_many :m_odr_file_roulages, :dependent => :destroy accepts_nested_attributes_for :m_odr_file_roulages, :allow_destroy => true