mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-07-14 05:54:35 +08:00
[ADD]组织、组织团队
This commit is contained in:
@@ -22,6 +22,8 @@ class TeamUser < ApplicationRecord
|
||||
belongs_to :team, counter_cache: :num_users
|
||||
belongs_to :user
|
||||
|
||||
validates :user_id, uniqueness: {scope: [:organization_id, :team_id]}
|
||||
|
||||
def self.build(organization_id, user_id, team_id)
|
||||
self.create!(organization_id: organization_id, user_id: user_id, team_id: team_id)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user