Ruby on Rails
Tuesday, July 31, 2012
Folks,
Unless I'm being dumb I cannot find anything on Google search or in the Rails books on how to create a one-to-one polymorphic association
(as apposed to a one-to-many polymorphic association). New to Rails so please forgive my ignorance. The situation is simple: I have the
following models/tables
- Person
generic concept (name, age, nationality, etc) which I want to attach polymorphically to concrete models suchs
- Staff
- Mother
- Farther
- Child
- etc
concrete class contain additional type specific information which I do not want nullable hence STI is not desirable
and would result in a sparse table.
If it matters this is for a charity.
Regards, Neil
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/FT6d45W1HIgJ.
For more options, visit https://groups.google.com/groups/opt_out.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment