I’m stumped. Imagine I have a bunch of assets. I want to be able to
them together (like in graphics programs), and then be able to group
into further groups.
What is the best way to do this?
I could have two models, Asset and AssetGroup, where Asset has_a url,
AssetGroup has_many Assets and has_many AssetGroups.
I could have one model: Asset, which has_a url and has_many Assets,
if it has a url it’s a “leaf” asset, and if it has some assets, it’s a
“branch.” It could have a type field, too.
The reason this is difficult is because I want to have other models be
to contain either an Asset or an Asset group, and treat them as the
the same thing.
How would you go about doing this?