remiboivin-zz / sos-confinement

MIT License
0 stars 0 forks source link

creating private messaging #1

Open remiboivin-zz opened 4 years ago

remiboivin-zz commented 4 years ago

Creating a private messaging for members

gathuku commented 4 years ago

Screenshot from 2020-03-24 13 45 48

class User
  has_many :conversations, thorough: :user_conversations
   has_many :messages
end

class Conversation
 has_many :users through: :user_conversations
 has_many :messages
end

class Message 
  belongs_to :user 
  belongs_to :conversation
end

class UserConversation
  belongs_to :user 
  belongs_to :conversation
end
gathuku commented 4 years ago

@remiboivin please review