I am building a Ruby On Rails API that helps manage construction documents -- there are a number of different types of documents that all have different fields, so I currently have a model for each.
However, I also would like the ability to refer to these documents in general, as each document can have an arbitrary number of associated documents, which can be of any document type. I'd like to be able to write something like
class Drawing < ApplicationRecord
...
has_many :associated_documents
Where all I need is the name, id, and type of the associated documents (essentially so that one can easily navigate between related documents in the front-end)
Is this a use case for Single Table Inheritance? Is there a way to do this with Polymorphic Associations? Since the front-end use case is a list of links, should I just store the links?