Ruby on Rails
Thursday, February 2, 2012
since there's a problem if I decide to use a seperate table for the subsections, because the to-dos etc maybe also in a section. So this is my question for now: should I have a separate table for subsections or should I do it with one table only (sections)? In other words, I want to implement a "nested sections" system.
Colin's suggestion for using "self referential" techniques is definitely recommended. Additionally, from your description it sounds like you could possibly have "to do"s and other items associated with with a range of objects in our site. If you do go down this path, you will want to investigate Rails' polymorphic relations. This would allow you to have "to do"s associated with sections, subsections, articles, orders, accounts, etc. I've used polymorphism to make one "picture" model available for association with users, articles, posts, products, etc. and it works pretty well.
Don
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/K6Am3ivcc7IJ.
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.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment