Im new to Rails and actually im trying to write my own messaging application. So far i have many users with username, password, etc. And now im figuering out how i should best write the migration for the message model. I thought that a message needs:
Message
sender_id => integer
recipent_id => integer
created_at => time
updated_at => time
The first problem im facing is that of course sender_id is unique but what is with recipent_id, there are often messages that should go to several people!
Next problem is i dont know how i have to refer form the user model to the message model i mean normaly i would write:
User has_many :messages
Message belongs_to :user
To do this i would need a coulmn named user_id in the message model , but now i have two cloumns sender_id and reciepent_id!
I hope you can give my some hints! Thanks