Using what I posted above you need to have the following:

In your Address model you need to have a

person_id
product_id

If you want these foreign keys to be different you can do the following:

Class Address
  belongs_to  :person
  belongs_to  :product  :foreign_key => uniquesomething_id
end

Whatever foreign_key you use, needs to be setup correctly in the table 
which belongs to the other table.

It really comes down to whatever you want to do and that's why 
diagraming is good because it allows you to see what you have before you 
implement things to make sure they work well.
-- 
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