class Team < ApplicationRecord validates :name, uniqueness: true, presence: true has_many :memberships has_many :users, through: :memberships end