feat: Bulk add team members in Team APIs (#1695)
This commit is contained in:
@@ -12,14 +12,26 @@
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_teams_on_account_id (account_id)
|
||||
# index_teams_on_account_id (account_id)
|
||||
# index_teams_on_name_and_account_id (name,account_id) UNIQUE
|
||||
#
|
||||
# Foreign Keys
|
||||
#
|
||||
# fk_rails_... (account_id => accounts.id)
|
||||
#
|
||||
class Team < ApplicationRecord
|
||||
include RegexHelper
|
||||
|
||||
belongs_to :account
|
||||
has_many :team_members, dependent: :destroy
|
||||
has_many :conversations, dependent: :nullify
|
||||
|
||||
validates :name,
|
||||
presence: { message: 'must not be blank' },
|
||||
format: { with: UNICODE_CHARACTER_NUMBER_HYPHEN_UNDERSCORE },
|
||||
uniqueness: { scope: :account_id }
|
||||
|
||||
before_validation do
|
||||
self.name = name.downcase if attribute_present?('name')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -10,8 +10,9 @@
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_team_members_on_team_id (team_id)
|
||||
# index_team_members_on_user_id (user_id)
|
||||
# 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)
|
||||
#
|
||||
# Foreign Keys
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user