Your input/experience appreciated. I have noticed multiple discussions regarding husband and wife. But none really end in a "this is a the best way to handle things." Here is my situation. I''m recording information on couples -- husband and wife, one of each. If the two are no longer married, the couple will evaporate. If either person is deleted, then couple will evaporate. I originally thought of having all individuals in one table, persons, and then creating couple with alink to each person. # == Schema Information # Schema version: 20100620123354 # # Table name: couples # # id :integer not null, primary key # active :boolean # husband_id :integer # reference to persons table # wife_id :integer # reference to persons table I was then thinking: belongs_to :husband,:class_name=>"Person",:foreign_key=>"husband_id" belongs_to :wife,:class_name=>"Person",:foreign_key=>"wife_id" and then having classes "Husband < Person" and "Wife < Person". Is this feasible? I am so torn I don''t know what step to take next. I''m early in development so I can do anything. But what I want to do is what is best. Do I stick with a couples table and one persons table? Do I create separate tables for husbands and wives? If I do this, can I create one Person class and Husband & Wife models inheriting Person...that way the two tables are created and migrated separately? You input is really appreciated. dvn -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 20 June 2010 20:05, dkmdnielsen <donvnielsen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Your input/experience appreciated. I have noticed multiple > discussions regarding husband and wife. But none really end in a > "this is a the best way to handle things."http://qntm.org/gay Of course, you can stop at level 7 or 8 if it suits you. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Outside of the fact that there is *really* excellent information in what your link provides, did it have to be so politically charged??? I can at least feel good that I am already at level seven, and some semantic changes puts me at eight. I would say stopping at eleven works for me (no sex or gender on table), but having gives us a bit of a heads up when talking with prospective couples on the phone. Knowing Terry or Sam or Francis is a woman gives us a little more information. So is the couple/partnership a child of the person table? Are partners 1 & 2 a belongs_to to Person? Do I try to do a habtm on person''s itself using a spouse id? I''m pretty green on setting up the syntax of all this. Not to mention figuring out the database constraints on the table itself. dvn On Jun 20, 3:11 pm, Michael Pavling <pavl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 20 June 2010 20:05, dkmdnielsen <donvniel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Your input/experience appreciated. I have noticed multiple > > discussions regarding husband and wife. But none really end in a > > "this is a the best way to handle things." > > http://qntm.org/gay > > Of course, you can stop at level 7 or 8 if it suits you.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
You provided this link elsewhere. This one, too, is excellent for setting up the syntax. http://guides.rails.info/association_basics.html#self-joins Have a good one! -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.