Is it possible to implement a model where: Exit is polymorphic and can be of type: Door, Window, FootPath and Rooms are related through Exits with eachother. I figured out that I would implement polymorphic exits, and on top of that I will use the through model, so the models'' definitions look like: class Room has_many :exits, has_many :rooms, through :exits class Exit belongs_to :resource, :polymorphic => true belongs_to :room class Door has_one :exit_entry, :as => :resource class Window has_one :exit_entry, :as => :resource class FootPath has_one :exit_entry, :as => :resource Also Im not sure what foreign key refering to Room should be in Exit? I quess I should have something like: origin_room_id goto_room_id but on the other hand the :through model requires, that there is room_id So overall any help on all that anyone? --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---