1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Associated wrestlers and tournaments through weights

This commit is contained in:
2015-03-28 14:48:36 +00:00
parent d7bbd32460
commit 43d7089b44
2 changed files with 2 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ class Tournament < ActiveRecord::Base
has_many :weights, dependent: :destroy
has_many :matches, dependent: :destroy
has_many :mats, dependent: :destroy
has_many :wrestlers, through: :weights
attr_accessor :upcomingMatches, :unfinishedMatches
serialize :matchups_array

View File

@@ -1,6 +1,7 @@
class Wrestler < ActiveRecord::Base
belongs_to :school
belongs_to :weight
has_one :tournament, through: :weight
attr_accessor :allMatches, :isWrestlingThisRound, :boutByRound, :seasonWinPercentage
def isWrestlingThisRound(matchRound)