From a0083ab939b18fd22786c46408658e520ee21b26 Mon Sep 17 00:00:00 2001 From: jcwimer Date: Wed, 25 Mar 2015 01:42:10 +0000 Subject: [PATCH] Currently not saving tournament.matchups_array --- app/models/tournament.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/models/tournament.rb b/app/models/tournament.rb index 7134ddd..776dec5 100644 --- a/app/models/tournament.rb +++ b/app/models/tournament.rb @@ -4,7 +4,7 @@ class Tournament < ActiveRecord::Base has_many :matches, dependent: :destroy has_many :mats, dependent: :destroy attr_accessor :upcomingMatches, :unfinishedMatches - serialize :matchups_array + serialize :matchups_array, Array def unfinishedMatches @@ -14,8 +14,7 @@ class Tournament < ActiveRecord::Base if self.matchups_array? return self.matchups_array else - @upcomingMatches = generateMatchups - return @upcomingMatches + return generateMatchups end end @@ -33,8 +32,8 @@ class Tournament < ActiveRecord::Base @upcomingMatches = weight.generateMatchups(@matches) end @upcomingMatches = assignBouts(@upcomingMatches) - self.matchups_array = @upcomingMatches - self.save + #self.matchups_array = @upcomingMatches + #self.save return @upcomingMatches end