Hey everyone. I’m trying to create a table of “messages” for my users.
It works just like an email application. Each user can send and
receive messages to/from other users in the system.
I’m not sure what sort of relationship to create between the user and
the messages. Is it has_many or has_and_belongs_to_many? I want each
message to have the following information:
status (new, read, replied, trashed)
type (user_msg, system_msg, friend_request, etc.)
I also want to be able to filter the messages based on their status
for the user. So they can view all their sent messages, new messages,
I appreciate any feedback. thanks.