This repository has been archived on 2021-11-24. You can view files and clone it, but cannot push or open issues or pull requests.
phone_app/app/models/p_product_assembled.rb
2021-08-23 10:26:02 +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