diff --git a/app/models/price_line.rb b/app/models/price_line.rb index 1dabff0..0eba34d 100644 --- a/app/models/price_line.rb +++ b/app/models/price_line.rb @@ -3,6 +3,12 @@ class PriceLine < ApplicationRecord belongs_to :p_product belongs_to :p_product_ref belongs_to :p_product_power + has_many :price_line_resp_selects, :foreign_key => :price_line_demand + has_many :price_line_resps, through: :price_line_resp_selects, :source => :price_line_resp + + + #has_many :price_line_demands, through: :price_line_resp_selects + default_scope { order('position ASC') } validates :p_product_ref_id, :presence => true, :if => :p_product_ref_needed?