I want to have the following relationships set up and, for the life of
me, I can’t get the bloody things to work:
class Company < ActiveRecord::Base
has_many :clients, :class_name => ‘Company’
has_many :suppliers, :class_name => ‘Company’
I have two tables set up called company_clients and company_suppliers
that each contain company_id and either client_id or supplier_id.
Any ideas on how I can get this to work? I’ve come up with workarounds
for it but none of them are elegant and I’d much rather do it properly.
Any help would be much appreciated.