lockaz_app/app/models/p_product_assembled.rb
Nicolas Bally f20fe482c6 initial
2020-04-06 10:38:07 +02:00

15 lines
331 B
Ruby

class PProductAssembled < ApplicationRecord
belongs_to :parent_product_ref, :class_name => "PProductRef"
belongs_to :p_product_ref
before_validation do
if self.parent_product_ref_id == self.p_product_ref_id
errors.add(:p_product_ref_id, 'ne peut pas être le produit parent')
end
end
end