In rails web app, user can "make" a
Document. There are different types of documents :
Each type of Document will have some things in common such as:
doc_id, at least
name, but then they have different attributes.
Loan is only doc with a
Business documents can have
If these docs may have different number of attributes, do they need to be completely separate
models, or is there a way to incorporate a
doc_type attribute for
Document which then reveals what, and how many, attributes are associated with the
Document? If so, what would that look like?
What you're describing is the express purpose of single-table inheritance in Rails.
Use one table with a super-set of all the fields from all the models. Add a
type column, and then create your three models, inheriting from a base model, and you're pretty much done.