From 79b903fc5632242a6ab1ee0f7732dec168331703 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Sun, 27 Apr 2014 01:50:33 -0400 Subject: Added 3 new seeding algorithms. --- app/models/tournament.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/models/tournament.rb b/app/models/tournament.rb index 2d4d6b6..154cc22 100644 --- a/app/models/tournament.rb +++ b/app/models/tournament.rb @@ -11,6 +11,7 @@ class Tournament < ActiveRecord::Base def settings @settings ||= Settings.new(self) end + def settings=(setting) setting.each do |key, value| value = false if value == "0" -- cgit v1.2.3-2-g168b From 5301997c80401e0fa5d106dd4dbcd330b4708cfb Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Sun, 27 Apr 2014 02:33:28 -0400 Subject: Added a standings view and used spaceships. --- app/views/tournaments/standings.html.erb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 app/views/tournaments/standings.html.erb (limited to 'app') diff --git a/app/views/tournaments/standings.html.erb b/app/views/tournaments/standings.html.erb new file mode 100644 index 0000000..28d3c22 --- /dev/null +++ b/app/views/tournaments/standings.html.erb @@ -0,0 +1,12 @@ +<% playerscores = @tournament.players.collect {|player| player => tournament.statistics.getStatistic(player.matches.last, player, :score) } %> + + + + + <% place = 0 %> + <% playerscores.sort {|player1, player2| playerscores[player1] <=> playerscores[player2] }.each |player| %> + + <% place += 1%> + <% end %> + +
Standings:<%= place.to_s + ":" %> <%= player.user_name %>
\ No newline at end of file -- cgit v1.2.3-2-g168b