From 927e21c067673a46c68e9ecfa191983ebb3874e7 Mon Sep 17 00:00:00 2001 From: guntasgrewal Date: Mon, 28 Apr 2014 21:12:22 -0400 Subject: Tournament Stage now displays correct stage number --- app/views/matches/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index 01484d3..bf5518f 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -5,7 +5,7 @@

Tournament stage: - <%= @match.tournament_stage %> + <%= @tournament.stages.order(:id).index(@match.tournament_stage)+1 %>

<%# -- cgit v1.2.3 From 8db5113a761d443374a64e5e9fe877fafa3f0a50 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Mon, 28 Apr 2014 21:21:47 -0400 Subject: Fixed status 2-3 transition and statistic sampling. --- app/models/match.rb | 4 ++-- lib/sampling/manual.html.erb | 2 +- lib/sampling/manual.rb | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/models/match.rb b/app/models/match.rb index 219e662..5c3a022 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -7,8 +7,8 @@ class Match < ActiveRecord::Base def finished? ok = true - tournament_stage.scoring_method.stats_needed.each do |stat| - ok &= statistics.where(match: self, name: stat).nil? + tournament_stage.scoring.stats_needed.each do |stat| + ok &= !statistics.where(match: self, name: stat).nil? end ok end diff --git a/lib/sampling/manual.html.erb b/lib/sampling/manual.html.erb index b783506..187f002 100644 --- a/lib/sampling/manual.html.erb +++ b/lib/sampling/manual.html.erb @@ -2,7 +2,7 @@ <% @match.teams.each do |team| %> <% end %> diff --git a/lib/sampling/manual.rb b/lib/sampling/manual.rb index 4e86925..01f6835 100644 --- a/lib/sampling/manual.rb +++ b/lib/sampling/manual.rb @@ -44,7 +44,10 @@ module Sampling end def handle_user_interaction(user, sampling_params) - # TODO + # => Save sampling_params as statistics + sampling_params.select {|name, value| @match.stats_from(self.class).include? name }.each do |name, value| + Statistic.create(name: value, user: user, match: @match) + end end end end -- cgit v1.2.3