Reiner,

I don't believe you have the need for polymorphic associations in the 
above example as you have a seperate association "type" already specced 
out for each relation

class Person < ActiveRecord::Base
has_many :documents
has_many :realties
end

class Document < ActiveRecord::Base
belongs_to :owner, class_name => "Person"
belongs_to :realty
end

class Realty < ActiveRecord::Base
belongs_to :owner, class_name => "Person"
has_many :leases, class_name => "Document"
end


Where do you need polymorphic associations in the above example?

p.s.  I know next to nothing about real estate so please forgive me if I 
got your relation wrong between documents and realties.. does a realty 
have many leases or is it the other way around??  :)

hth
ilan


> 
> So, how to implement this idea, and to be able to easly extend the list
> of linkable objects? Is it possible to avoid any association-definitions
> in the linkable models?
> 
> Thank you for your help,
> 
> 
> Reiner

-- 
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