I’m stumped. Imagine I have a bunch of assets. I want to be able to group them together (like in graphics programs), and then be able to group them into further groups.
What is the best way to do this?
I could have two models, Asset and AssetGroup, where Asset has_a url, and AssetGroup has_many Assets and has_many AssetGroups.
I could have one model: Asset, which has_a url and has_many Assets, where 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 able to contain either an Asset or an Asset group, and treat them as the roughly the same thing.
How would you go about doing this?