[ADD]组织、组织团队

This commit is contained in:
2021-01-15 14:55:52 +08:00
parent c278ed1863
commit 7f309edc91
37 changed files with 667 additions and 57 deletions
+2
View File
@@ -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