mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Removed unnecessary attr_accessors
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
class Match < ActiveRecord::Base
|
class Match < ActiveRecord::Base
|
||||||
belongs_to :tournament
|
belongs_to :tournament
|
||||||
WIN_TYPES = ["Decision", "Major", "Tech Fall", "Pin", "Forfeit", "Injury Default", "Default", "DQ"]
|
WIN_TYPES = ["Decision", "Major", "Tech Fall", "Pin", "Forfeit", "Injury Default", "Default", "DQ"]
|
||||||
attr_accessor :weight_max, :w1_name, :w1_name
|
|
||||||
|
|
||||||
def weight_max
|
def weight_max
|
||||||
@guy = Wrestler.find(self.r_id)
|
@guy = Wrestler.find(self.r_id)
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
class Poolbracket
|
class Poolbracket
|
||||||
attr_accessor :weight
|
|
||||||
|
|
||||||
def generateBracketMatches(matches,weight,highest_round)
|
def generateBracketMatches(matches,weight,highest_round)
|
||||||
if weight.pool_bracket_type == "twoPoolsToSemi"
|
if weight.pool_bracket_type == "twoPoolsToSemi"
|
||||||
matches = twoPoolsToSemi(matches,weight,highest_round)
|
matches = twoPoolsToSemi(matches,weight,highest_round)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class School < ActiveRecord::Base
|
class School < ActiveRecord::Base
|
||||||
belongs_to :tournament
|
belongs_to :tournament
|
||||||
has_many :wrestlers, dependent: :destroy
|
has_many :wrestlers, dependent: :destroy
|
||||||
attr_accessor :score
|
|
||||||
|
|
||||||
#calculate score here
|
#calculate score here
|
||||||
def score
|
def score
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class Tournament < ActiveRecord::Base
|
|||||||
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
|
has_many :wrestlers, through: :weights
|
||||||
attr_accessor :upcomingMatches, :unfinishedMatches
|
|
||||||
serialize :matchups_array
|
serialize :matchups_array
|
||||||
|
|
||||||
def unfinishedMatches
|
def unfinishedMatches
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ class Weight < ActiveRecord::Base
|
|||||||
belongs_to :tournament
|
belongs_to :tournament
|
||||||
has_many :wrestlers, dependent: :destroy
|
has_many :wrestlers, dependent: :destroy
|
||||||
|
|
||||||
attr_accessor :pools, :bracket_size, :bracket_type, :poolRounds, :totalRounds
|
attr_accessor :pools
|
||||||
|
|
||||||
before_save do
|
before_save do
|
||||||
self.tournament.matchups_array = nil
|
self.tournament.matchups_array = nil
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ class Wrestler < ActiveRecord::Base
|
|||||||
belongs_to :school
|
belongs_to :school
|
||||||
belongs_to :weight
|
belongs_to :weight
|
||||||
has_one :tournament, through: :weight
|
has_one :tournament, through: :weight
|
||||||
attr_accessor :allMatches, :isWrestlingThisRound, :boutByRound, :seasonWinPercentage, :poolNumber
|
attr_accessor :poolNumber
|
||||||
|
|
||||||
before_save do
|
before_save do
|
||||||
self.tournament.matchups_array = nil
|
self.tournament.matchups_array = nil
|
||||||
self.tournament.save
|
self.tournament.save
|
||||||
|
|||||||
Reference in New Issue
Block a user