sportdb 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sportdb/models/city.rb +1 -1
- data/lib/sportdb/models/league.rb +3 -1
- data/lib/sportdb/schema.rb +2 -2
- data/lib/sportdb/version.rb +1 -1
- metadata +3 -3
data/lib/sportdb/models/city.rb
CHANGED
@@ -4,7 +4,7 @@ class City < ActiveRecord::Base
|
|
4
4
|
self.table_name = 'cities'
|
5
5
|
|
6
6
|
belongs_to :country, :class_name => 'Country', :foreign_key => 'country_id'
|
7
|
-
belongs_to :region, :class_name => 'Region', :foreign_key => '
|
7
|
+
belongs_to :region, :class_name => 'Region', :foreign_key => 'region_id'
|
8
8
|
|
9
9
|
has_many :teams, :class_name => 'Team', :foreign_key => 'city_id'
|
10
10
|
|
@@ -5,10 +5,12 @@ class League < ActiveRecord::Base
|
|
5
5
|
|
6
6
|
## leagues also used for conferences, world series, cups, etc.
|
7
7
|
#
|
8
|
-
## league (cup/conference/series/etc.) + season (year) = event
|
8
|
+
## league (or cup/conference/series/etc.) + season (or year) = event
|
9
9
|
|
10
10
|
has_many :events
|
11
11
|
has_many :seasons, :through => :events
|
12
|
+
|
13
|
+
belongs_to :country, :class_name => 'Country', :foreign_key => 'country_id'
|
12
14
|
|
13
15
|
|
14
16
|
def self.create_from_ary!( leagues, more_values={} )
|
data/lib/sportdb/schema.rb
CHANGED
@@ -76,9 +76,9 @@ create_table :rounds do |t|
|
|
76
76
|
t.string :title, :null => false
|
77
77
|
t.string :title2
|
78
78
|
t.integer :pos, :null => false
|
79
|
-
## todo/fix: rename to knockout???
|
80
79
|
## add new table stage/stages for grouping rounds in group rounds and playoff rounds, for example???
|
81
|
-
|
80
|
+
## # "regular" season (group) games or post-season (playoff) knockouts (k.o's)
|
81
|
+
t.boolean :knockout, :null => false, :default => false
|
82
82
|
t.datetime :start_at, :null => false
|
83
83
|
t.datetime :end_at # todo: make it required e.g. :null => false
|
84
84
|
t.timestamps
|
data/lib/sportdb/version.rb
CHANGED
metadata
CHANGED