tournament 3.2.1 → 3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,6 @@
1
+ == 3.2.2 / 2009-03-14
2
+ * Fix initialization of tournament entry.
3
+
1
4
  == 3.2.1 / 2009-03-14
2
5
  * Fix teams selection controller to not care about the order of
3
6
  input seedings.
@@ -7,7 +7,7 @@ unless defined? Tournament
7
7
  module Tournament
8
8
 
9
9
  # :stopdoc:
10
- VERSION = '3.2.1'
10
+ VERSION = '3.2.2'
11
11
  LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
12
12
  PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
13
13
  # :startdoc:
@@ -62,7 +62,10 @@ class AdminController < ApplicationController
62
62
  pool = Pool.find(params[:id])
63
63
  # This is confusing ...
64
64
  @pool = pool.pool
65
- @entry = Entry.find_or_initialize_by_user_id(:user_id => current_user.id, :pool_id => pool.id, :tie_break => 0, :name => 'Tournament Bracket')
65
+ @entry = Entry.find_or_initialize_by_user_id_and_pool_id(current_user.id, pool.id) do |e|
66
+ e.tie_break = 0
67
+ e.name = 'Tournament Bracket'
68
+ end
66
69
  @entry.bracket
67
70
  @entry.save(false)
68
71
 
@@ -67,7 +67,7 @@ class Pool < ActiveRecord::Base
67
67
  end
68
68
  (0..3).each {|n| reg_ret[n] ||= ['', Array.new(16)]}
69
69
 
70
- self.seedings.each_with_index do |t, idx|
70
+ self.seedings.each do |t|
71
71
  region = reg_ret.find {|name, teams| name == t.region} || reg_ret.find {|name, teams| name.blank?}
72
72
  region[0] = t.region
73
73
  region[1][t.seed-1] = t.team
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 3
7
7
  - 2
8
- - 1
9
- version: 3.2.1
8
+ - 2
9
+ version: 3.2.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Douglas A. Seifert