mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-19 14:00:27 +00:00
Currently not saving tournament.matchups_array
This commit is contained in:
@@ -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
|
||||||
attr_accessor :upcomingMatches, :unfinishedMatches
|
attr_accessor :upcomingMatches, :unfinishedMatches
|
||||||
serialize :matchups_array
|
serialize :matchups_array, Array
|
||||||
|
|
||||||
def unfinishedMatches
|
def unfinishedMatches
|
||||||
|
|
||||||
@@ -14,8 +14,7 @@ class Tournament < ActiveRecord::Base
|
|||||||
if self.matchups_array?
|
if self.matchups_array?
|
||||||
return self.matchups_array
|
return self.matchups_array
|
||||||
else
|
else
|
||||||
@upcomingMatches = generateMatchups
|
return generateMatchups
|
||||||
return @upcomingMatches
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -33,8 +32,8 @@ class Tournament < ActiveRecord::Base
|
|||||||
@upcomingMatches = weight.generateMatchups(@matches)
|
@upcomingMatches = weight.generateMatchups(@matches)
|
||||||
end
|
end
|
||||||
@upcomingMatches = assignBouts(@upcomingMatches)
|
@upcomingMatches = assignBouts(@upcomingMatches)
|
||||||
self.matchups_array = @upcomingMatches
|
#self.matchups_array = @upcomingMatches
|
||||||
self.save
|
#self.save
|
||||||
return @upcomingMatches
|
return @upcomingMatches
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user