Initial commit: monorepo Match Live TV.
Rails API, app Flutter, infrastruttura Docker/MediaMTX, sito marketing e documentazione di deploy. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
19
backend/app/models/team.rb
Normal file
19
backend/app/models/team.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
class Team < ApplicationRecord
|
||||
has_many :user_teams, dependent: :destroy
|
||||
has_many :users, through: :user_teams
|
||||
has_many :matches, dependent: :destroy
|
||||
has_one :youtube_credential, dependent: :destroy
|
||||
has_one :subscription, dependent: :destroy
|
||||
has_many :recordings, dependent: :destroy
|
||||
has_many :team_invitations, dependent: :destroy
|
||||
|
||||
validates :name, presence: true
|
||||
|
||||
def entitlements
|
||||
@entitlements ||= Teams::Entitlements.new(self)
|
||||
end
|
||||
|
||||
def owner
|
||||
user_teams.find_by(role: "owner")&.user
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user