Displaying 1 result from an estimated 1 matches for "machine_service_item".
Did you mean:
machine_service_items
2006 Jul 13
0
Adding attributes to many through associations
...I create machines, I define
which ones out of all services can be applied to this particular
machine. Every chosen service should have several attributes (prices in
this case) which will be different for each machine. Here''s my models:
class Machine < ActiveRecord::Base
has_many :machine_service_items
has_many :services, :through => :machine_service_items
end
class Service < ActiveRecord::Base
has_many :machine_service_items
has_many :machines, :through => :machine_service_items
end
class MachineServiceItem < ActiveRecord::Base
belongs_to :machine
belongs_to :service
end...