Files
euchre_camp/lib/euchre_camp/persistence/relations/teams.rb
T
david ac858f1e6d feat(tournaments): add partnership tracking and tournament management
Implement comprehensive partnership tracking system and tournament
management features including round-robin, single/double elimination,
and Swiss system pairings.

Changes:
- Add partnership_games and partnership_stats tables
- Implement PartnershipTracker service for recording partnership data
- Add tournament generator with multiple formats
- Create tournament management actions and views
- Add acceptance tests for partnership tracking
- Fix PartnershipTracker to use single snapshot per player per match
- Fix round-robin test to query by round_number instead of hardcoded ID

Note: All 8 acceptance tests now passing
2026-03-27 12:25:34 -07:00

27 lines
858 B
Ruby

# frozen_string_literal: true
module EuchreCamp
module Persistence
module Relations
class Teams < ROM::Relation[:sql]
schema(:teams, infer: true) do
attribute :id, ROM::Types::Integer, primary_key: true
attribute :event_id, ROM::Types::Integer
attribute :team_name, ROM::Types::String.optional
attribute :player_1_id, ROM::Types::Integer
attribute :player_2_id, ROM::Types::Integer
attribute :created_at, ROM::Types::DateTime
associations do
belongs_to :event
belongs_to :player_1, relation: :players, foreign_key: :player_1_id
belongs_to :player_2, relation: :players, foreign_key: :player_2_id
has_many :event_participants
has_many :bracket_matchups
end
end
end
end
end
end