[Rails] Re: Menu structure with multiple parents?
On Jul 15, 2:03 am, Heinz Strunk <li...@ruby-forum.com> wrote:
> What do you guys think of:
> has_and_belongs_to_many :parents, :class_name => "Menu",
> :association_foreign_key => "parent_id", :join_table => "menus_parents"
I think it's astoundingly bad UI to have identical options in more
than one place - but that's just my opinion.
Unless your Menu model is exceptionally complicated, is it *really*
worth the significant boost in both code and SQL complexity just to
support this (hopefully uncommon) edge case? DRY is great, but there's
a point of diminishing (if not negative) returns...
As to the technical side of the question, you'd want to use a real
join model (with has_many :through). How else could you keep track of
the position of the repeated items in each of the parent menus?
--Matt Jones
--
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.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home