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:
@@ -3,6 +3,7 @@ class Tournament < ActiveRecord::Base
|
|||||||
has_many :weights, dependent: :destroy
|
has_many :weights, dependent: :destroy
|
||||||
has_many :matches, dependent: :destroy
|
has_many :matches, dependent: :destroy
|
||||||
has_many :mats, dependent: :destroy
|
has_many :mats, dependent: :destroy
|
||||||
|
has_many :wrestlers, through: :weights
|
||||||
attr_accessor :upcomingMatches, :unfinishedMatches
|
attr_accessor :upcomingMatches, :unfinishedMatches
|
||||||
serialize :matchups_array
|
serialize :matchups_array
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
class Wrestler < ActiveRecord::Base
|
class Wrestler < ActiveRecord::Base
|
||||||
belongs_to :school
|
belongs_to :school
|
||||||
belongs_to :weight
|
belongs_to :weight
|
||||||
|
has_one :tournament, through: :weight
|
||||||
attr_accessor :allMatches, :isWrestlingThisRound, :boutByRound, :seasonWinPercentage
|
attr_accessor :allMatches, :isWrestlingThisRound, :boutByRound, :seasonWinPercentage
|
||||||
|
|
||||||
def isWrestlingThisRound(matchRound)
|
def isWrestlingThisRound(matchRound)
|
||||||
|
|||||||
Reference in New Issue
Block a user