Hi
I have a message model and message_participants table.
message_participants table because same message goes to various
recipients.
Messaging between either company to users OR user to company. So an
initial design of tables made like
Hi
I have a message model and message_participants table.
message_participants table because same message goes to various
recipients.
Messaging between either company to users OR user to company.
[...]
Here about 'type' field I am not sure. My question is should I treat
message_participants like STI or polymorphic? I can't decide it.
STI: single-table *inheritance*. Does User inherit from Company, or
Company from User? Probably not. So no inheritance is involved, and
you probably want a polymorphic association.