2021-01-17 18:26:56 +00:00
|
|
|
# == Schema Information
|
|
|
|
#
|
|
|
|
# Table name: team_members
|
|
|
|
#
|
|
|
|
# id :bigint not null, primary key
|
|
|
|
# created_at :datetime not null
|
|
|
|
# updated_at :datetime not null
|
|
|
|
# team_id :bigint not null
|
|
|
|
# user_id :bigint not null
|
|
|
|
#
|
|
|
|
# Indexes
|
|
|
|
#
|
2021-01-29 07:04:52 +00:00
|
|
|
# index_team_members_on_team_id (team_id)
|
|
|
|
# index_team_members_on_team_id_and_user_id (team_id,user_id) UNIQUE
|
|
|
|
# index_team_members_on_user_id (user_id)
|
2021-01-17 18:26:56 +00:00
|
|
|
#
|
|
|
|
class TeamMember < ApplicationRecord
|
|
|
|
belongs_to :user
|
|
|
|
belongs_to :team
|
2021-12-21 17:18:01 +00:00
|
|
|
validates :user_id, uniqueness: { scope: :team_id }
|
2021-01-17 18:26:56 +00:00
|
|
|
end
|