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'

end

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.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to