I have some documents in database. They come in different types, so I have several models representing documents. Now, what if I need to list them all by column, let's say
My initial database design had each type of the document reside in its own table, like
proofs etc. I also had separate
documents table with
type, using polymorphic relations.
This is a little troublesome though, because I need to use
user_id very often for each document type and fetching it through morphing each time is a little much.
How would you guys define this relation?