sadem_app/app/models/m_odr_product.rb
Nicolas Bally 2e982b4fd2 suite
2020-02-27 13:51:18 +01:00

21 lines
370 B
Ruby

class MOdrProduct < ApplicationRecord
belongs_to :m_odr_brand
has_many :m_odr_product_remises, :dependent => :destroy
accepts_nested_attributes_for :m_odr_product_remises, :allow_destroy => true
def member_label
if self.m_odr_brand
"#{self.m_odr_brand.name} - #{self.name}"
else
self.name
end
end
end