Leonid Raiz
2006-Dec-30 19:50 UTC
How to choose foreign key side of one-to-one association?
When designing a new RoR application are there some fundamental database considerations for selecting which table should contain a foreign key column of one-to-one relationship? Say, in my application I have Orders and Invoices. Both belongs_to and has_one methods give me a way to access the other side of association and I know that belongs_to goes into a model that records the foreign key. But is there some line of reasoning for selecting to store order_id in invoices table vs. storing invoice_id in orders table? Does it make much difference? -- 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 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 -~----------~----~----~----~------~----~------~--~---