On Jul 15, 2:03 am, Heinz S. [email protected] 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?