conversation.rb 308 B

12345678910
  1. class Conversation < ApplicationRecord
  2. validates :name, presence: true, length: { maximum: 255 }
  3. has_many :messages, dependent: :destroy
  4. accepts_nested_attributes_for :messages
  5. has_many :conversation_participations, dependent: :destroy
  6. has_many :users, through: :conversation_participations
  7. end