# frozen_string_literal: true require 'rom-repository' module EuchreCamp module Repositories class BracketMatchups < ::EuchreCamp::Repository[:bracket_matchups] commands :create, update: :by_pk, delete: :by_pk def by_event(event_id) bracket_matchups.where(event_id: event_id).to_a end def by_round(round_id) bracket_matchups.where(round_id: round_id).order(:bracket_position).to_a end def by_event_and_round(event_id, round_id) bracket_matchups .where(event_id: event_id, round_id: round_id) .order(:bracket_position) .to_a end end end end