Hi, I am looking for experience and similar solutions to a problem.
Authors on our platform upload projects. They would like to organize their files in “folders”. I was thinking of using Active Storage and introducing an object like MyActiveStorage::Folder. In this way I could give structure to the files. The folders are records in the db and each folder knows its files and subfolders. So actually a record could have
class Article < ApplicationRecord
has_many_attached :files
has_root_folder :root_folder # or something similar that knows that attachment on the first level and its children and is basically a tree structure in db.
end
Article knows all of its files linearly while by accessing “:root_folder” you can access list them as a tree.
My question is - do you know of anything similar to that. Anything I could look for more inspiration on this problem and the solutions others have thought of?
Thanks