Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use fixtures from sport.db

  • Loading branch information...
commit 7c6924be96bde67393c264c43d7b4bdfd0250c7a 1 parent bc90ec3
@geraldb geraldb authored
Showing with 368 additions and 384 deletions.
  1. +1 −0  Gemfile
  2. +2 −0  Gemfile.lock
  3. +3 −2 app/helpers/application_helper.rb
  4. +1 −1  app/views/layouts/_header.html.erb
  5. +1 −1  app/views/layouts/application.html.erb
  6. +4 −4 app/views/sessions/new.html.erb
  7. +311 −311 db/schema.rb
  8. +7 −0 db/seeds.rb
  9. +1 −0  db/seeds/at/2011_12/bl.rb
  10. +3 −0  db/seeds/at/2011_12/cup.rb
  11. +1 −0  db/seeds/at/2012_13/bl.rb
  12. 0  db/seeds/{austria → at}/2012_13/bl_quotes.rb
  13. +5 −0 db/seeds/at/2012_13/cup.rb
  14. 0  db/seeds/{austria → at}/2012_13/cup_2.rb
  15. 0  db/seeds/{austria → at}/2012_13/cup_quotes.rb
  16. 0  db/seeds/{austria → at}/teams.rb
  17. +0 −1  db/seeds/austria/2011_12/bl.rb
  18. +0 −6 db/seeds/austria/2011_12/cup.rb
  19. +0 −1  db/seeds/austria/2012_13/bl.rb
  20. +0 −10 db/seeds/austria/2012_13/cup.rb
  21. +1 −6 db/seeds/cl/2011_12/cl.rb
  22. +2 −7 db/seeds/cl/2011_12/el.rb
  23. +1 −6 db/seeds/cl/2012_13/cl.rb
  24. +1 −1  db/seeds/cl/teams.rb
  25. +0 −2  db/seeds/demo/pools.rb
  26. +0 −2  db/seeds/demo/users.rb
  27. +3 −6 db/seeds/euro/2012.rb
  28. +0 −2  db/seeds/mexico/apertura_2012.rb
  29. +2 −0  db/seeds/mx/apertura_2012.rb
  30. 0  db/seeds/{mexico → mx}/teams.rb
  31. +2 −0  db/seeds/ro/l1_2012_13.rb
  32. 0  db/seeds/{romania → ro}/teams.rb
  33. +0 −2  db/seeds/romania/l1_2012_13.rb
  34. +0 −2  db/seeds/services.rb
  35. +0 −2  db/seeds/uss/others_pools.rb
  36. +0 −2  db/seeds/uss/users.rb
  37. +1 −1  db/seeds/world/quali_2012_13.rb
  38. +0 −2  db/seeds/world/quali_2012_13_2.rb
  39. +15 −4 lib/tasks/load_uss_others.rake
View
1  Gemfile
@@ -6,6 +6,7 @@ gem 'kramdown' # all ruby markdown processor/engine
gem 'rails', '3.2.1'
gem 'rails-i18n' # see https://github.com/svenfuchs/rails-i18n
+gem 'sportdb', '0.3.0' # see https://github.com/geraldb/sport.db
group :production do
gem 'pg'
View
2  Gemfile.lock
@@ -97,6 +97,7 @@ GEM
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
+ sportdb (0.3.0)
sprockets (2.1.2)
hike (~> 1.2)
rack (~> 1.0)
@@ -133,6 +134,7 @@ DEPENDENCIES
rails-i18n
ri_cal
sass-rails (~> 3.2.3)
+ sportdb (= 0.3.0)
sqlite3
thin
uglifier (>= 1.0.3)
View
5 app/helpers/application_helper.rb
@@ -5,7 +5,8 @@ module ApplicationHelper
def powered_by
## todo/fix: use version from wettpool module
content_tag :div do
- link_to( 'Wettpool/1', 'http://geraldb.github.com/wettpool' ) + ' - ' +
+ link_to( 'Sportbook/1', 'https://github.com/geraldb/sportbook' ) + ', ' +
+ link_to( "sport.db/#{SportDB::VERSION}", 'https://github.com/geraldb/sport.db' ) + ' - ' +
content_tag( :span, "Ruby/#{RUBY_VERSION} (#{RUBY_RELEASE_DATE}/#{RUBY_PLATFORM}) on") + ' ' +
content_tag( :span, "Rails/#{Rails.version} (#{Rails.env})" )
## content_tag( :span, "#{request.headers['SERVER_SOFTWARE'] || request.headers['SERVER']}" )
@@ -15,7 +16,7 @@ def powered_by
def title(*parts)
unless parts.empty?
content_for :title do
- (parts << 'Wettpool').join( '' )
+ (parts << 'Sportbook').join( '' )
end
end
end
View
2  app/views/layouts/_header.html.erb
@@ -2,7 +2,7 @@
<% if content_for? :title %>
<%= yield :title %>
<% else %>
- Wettpool
+ Sportbook
<% end %>
</title>
View
2  app/views/layouts/application.html.erb
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
- <%= render :partial => 'layouts/header' %>
+ <%= render :partial => 'layouts/header' %>
</head>
<body>
View
8 app/views/sessions/new.html.erb
@@ -1,15 +1,15 @@
-<h1>Wettpool Anmeldung</h1>
+<h1>Sportbook Anmeldung</h1>
<table>
<tr>
<td><!-- begin 1st column -->
-<% if request.host == 'wettpool.herokuapp.com' || request.host == 'localhost' %>
+<% if request.host == 'sportbook.herokuapp.com' || request.host == 'localhost' %>
<div>
- <b>Welcome.</b> Wettpool - A Free, Open Source Sports Betting Pool
+ <b>Welcome.</b> Sportbook - A Free, Open Source Sports Betting Pool
(Euro 2012, Champions League 2012, etc.) in Ruby on Rails.
- <a href="http://geraldb.github.com/wettpool">More &raquo;</a>
+ <a href="https://github.com/geraldb/sportbook">More &raquo;</a>
</div>
<% end %>
<!-- end 1st column -->
View
622 db/schema.rb
@@ -1,311 +1,311 @@
-# encoding: UTF-8
-# This file is auto-generated from the current state of the database. Instead
-# of editing this file, please use the migrations feature of Active Record to
-# incrementally modify your database, and then regenerate this schema definition.
-#
-# Note that this schema.rb definition is the authoritative source for your
-# database schema. If you need to create the application database on another
-# system, you should be using db:schema:load, not running all the migrations
-# from scratch. The latter is a flawed and unsustainable approach (the more migrations
-# you'll amass, the slower it'll run and the greater likelihood for issues).
-#
-# It's strongly recommended to check this file into your version control system.
-
-ActiveRecord::Schema.define(:version => 20120305214015) do
-
- create_table "actions", :force => true do |t|
- t.text "text"
- t.string "tmpl"
- t.integer "user_id"
- t.integer "event_id"
- t.integer "pool_id"
- t.integer "game_id"
- t.integer "tip_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "bonus_answers", :force => true do |t|
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "bonus_points", :force => true do |t|
- t.integer "user_id", :null => false
- t.integer "pool_id", :null => false
- t.integer "round_id", :null => false
- t.integer "round_pts", :default => 0, :null => false
- t.integer "round_pos", :default => 0, :null => false
- t.integer "total_pts", :default => 0, :null => false
- t.integer "total_pos", :default => 0, :null => false
- t.integer "diff_total_pos", :default => 0, :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "bonus_points", ["user_id", "pool_id", "round_id"], :name => "index_bonus_points_on_user_id_and_pool_id_and_round_id", :unique => true
-
- create_table "bonus_questions", :force => true do |t|
- t.integer "round_id", :null => false
- t.string "title", :null => false
- t.integer "pos", :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "bonus_rounds", :force => true do |t|
- t.integer "pool_id", :null => false
- t.string "title", :null => false
- t.integer "pos", :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "bonus_tips", :force => true do |t|
- t.integer "user_id", :null => false
- t.integer "question_id", :null => false
- t.integer "pts", :default => 0, :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "event_quotes", :force => true do |t|
- t.integer "service_id", :null => false
- t.integer "event_id", :null => false
- t.integer "team_id", :null => false
- t.decimal "odds", :null => false
- t.string "comments"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "events", :force => true do |t|
- t.string "title", :null => false
- t.string "key", :null => false
- t.boolean "team3", :default => true, :null => false
- t.datetime "start_at", :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "events", ["key"], :name => "index_events_on_key", :unique => true
-
- create_table "events_teams", :force => true do |t|
- t.integer "event_id", :null => false
- t.integer "team_id", :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "events_teams", ["event_id", "team_id"], :name => "index_events_teams_on_event_id_and_team_id", :unique => true
- add_index "events_teams", ["event_id"], :name => "index_events_teams_on_event_id"
-
- create_table "games", :force => true do |t|
- t.integer "round_id", :null => false
- t.integer "pos", :null => false
- t.integer "group_id"
- t.integer "team1_id", :null => false
- t.integer "team2_id", :null => false
- t.datetime "play_at", :null => false
- t.boolean "knockout", :default => false, :null => false
- t.boolean "home", :default => true, :null => false
- t.boolean "locked", :default => false, :null => false
- t.integer "score1"
- t.integer "score2"
- t.integer "score3"
- t.integer "score4"
- t.integer "score5"
- t.integer "score6"
- t.integer "next_game_id"
- t.integer "prev_game_id"
- t.string "toto12x"
- t.string "key"
- t.string "type"
- t.boolean "calc", :default => false, :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "games", ["group_id"], :name => "index_games_on_group_id"
- add_index "games", ["key"], :name => "index_games_on_key", :unique => true
- add_index "games", ["next_game_id"], :name => "index_games_on_next_game_id"
- add_index "games", ["prev_game_id"], :name => "index_games_on_prev_game_id"
- add_index "games", ["round_id"], :name => "index_games_on_round_id"
-
- create_table "group_quotes", :force => true do |t|
- t.integer "service_id", :null => false
- t.integer "group_id", :null => false
- t.integer "team_id", :null => false
- t.decimal "odds", :null => false
- t.string "comments"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "groups", :force => true do |t|
- t.integer "event_id", :null => false
- t.string "title", :null => false
- t.integer "pos", :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "groups", ["event_id"], :name => "index_groups_on_event_id"
-
- create_table "groups_teams", :force => true do |t|
- t.integer "group_id", :null => false
- t.integer "team_id", :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "groups_teams", ["group_id", "team_id"], :name => "index_groups_teams_on_group_id_and_team_id", :unique => true
- add_index "groups_teams", ["group_id"], :name => "index_groups_teams_on_group_id"
-
- create_table "plays", :force => true do |t|
- t.integer "user_id", :null => false
- t.integer "pool_id", :null => false
- t.integer "team1_id"
- t.integer "team2_id"
- t.integer "team3_id"
- t.integer "total_pts", :default => 0, :null => false
- t.integer "total_pos", :default => 0, :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "plays", ["pool_id"], :name => "index_plays_on_pool_id"
- add_index "plays", ["user_id", "pool_id"], :name => "index_plays_on_user_id_and_pool_id", :unique => true
- add_index "plays", ["user_id"], :name => "index_plays_on_user_id"
-
- create_table "points", :force => true do |t|
- t.integer "user_id", :null => false
- t.integer "pool_id", :null => false
- t.integer "round_id", :null => false
- t.integer "round_pts", :default => 0, :null => false
- t.integer "round_pos", :default => 0, :null => false
- t.integer "total_pts", :default => 0, :null => false
- t.integer "total_pos", :default => 0, :null => false
- t.integer "diff_total_pos", :default => 0, :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "points", ["user_id", "pool_id", "round_id"], :name => "index_points_on_user_id_and_pool_id_and_round_id", :unique => true
-
- create_table "pools", :force => true do |t|
- t.integer "event_id", :null => false
- t.string "title", :null => false
- t.integer "user_id", :null => false
- t.boolean "fix", :default => false, :null => false
- t.boolean "public", :default => true, :null => false
- t.boolean "locked", :default => false, :null => false
- t.text "welcome"
- t.text "welcome_html"
- t.string "key"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "pools", ["event_id"], :name => "index_pools_on_event_id"
- add_index "pools", ["key"], :name => "index_pools_on_key", :unique => true
- add_index "pools", ["user_id"], :name => "index_pools_on_user_id"
-
- create_table "props", :force => true do |t|
- t.string "key", :null => false
- t.string "value", :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "quotes", :force => true do |t|
- t.integer "service_id", :null => false
- t.integer "game_id", :null => false
- t.decimal "odds1", :null => false
- t.decimal "oddsx", :null => false
- t.decimal "odds2", :null => false
- t.string "comments"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "rounds", :force => true do |t|
- t.integer "event_id", :null => false
- t.string "title", :null => false
- t.string "title2"
- t.integer "pos", :null => false
- t.boolean "playoff", :default => false, :null => false
- t.boolean "flex", :default => true, :null => false
- t.boolean "fix", :default => true, :null => false
- t.string "type"
- t.boolean "calc", :default => false, :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "rounds", ["event_id"], :name => "index_rounds_on_event_id"
-
- create_table "services", :force => true do |t|
- t.string "title", :null => false
- t.string "key", :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "teams", :force => true do |t|
- t.string "title", :null => false
- t.string "title2"
- t.string "key", :null => false
- t.string "img"
- t.string "tag"
- t.string "type"
- t.boolean "calc", :default => false, :null => false
- t.string "calc_rule"
- t.string "calc_value"
- t.integer "calc_team_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "teams", ["key"], :name => "index_teams_on_key", :unique => true
-
- create_table "tips", :force => true do |t|
- t.integer "user_id", :null => false
- t.integer "pool_id", :null => false
- t.integer "game_id", :null => false
- t.integer "score1"
- t.integer "score2"
- t.integer "score3"
- t.integer "score4"
- t.integer "score5"
- t.integer "score6"
- t.string "toto12x"
- t.string "type"
- t.boolean "calc", :default => false, :null => false
- t.integer "calc_team1_id"
- t.integer "calc_team2_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "tips", ["game_id"], :name => "index_tips_on_game_id"
- add_index "tips", ["pool_id"], :name => "index_tips_on_pool_id"
- add_index "tips", ["user_id", "pool_id", "game_id"], :name => "index_tips_on_user_id_and_pool_id_and_game_id", :unique => true
- add_index "tips", ["user_id"], :name => "index_tips_on_user_id"
-
- create_table "users", :force => true do |t|
- t.string "name", :null => false
- t.string "email", :null => false
- t.string "password_digest"
- t.string "key", :null => false
- t.boolean "admin", :default => false, :null => false
- t.boolean "guest", :default => false, :null => false
- t.boolean "active", :default => true, :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "users", ["email"], :name => "index_users_on_email", :unique => true
- add_index "users", ["key"], :name => "index_users_on_key", :unique => true
-
-end
+# encoding: UTF-8
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended to check this file into your version control system.
+
+ActiveRecord::Schema.define(:version => 20120305214015) do
+
+ create_table "actions", :force => true do |t|
+ t.text "text"
+ t.string "tmpl"
+ t.integer "user_id"
+ t.integer "event_id"
+ t.integer "pool_id"
+ t.integer "game_id"
+ t.integer "tip_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "bonus_answers", :force => true do |t|
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "bonus_points", :force => true do |t|
+ t.integer "user_id", :null => false
+ t.integer "pool_id", :null => false
+ t.integer "round_id", :null => false
+ t.integer "round_pts", :default => 0, :null => false
+ t.integer "round_pos", :default => 0, :null => false
+ t.integer "total_pts", :default => 0, :null => false
+ t.integer "total_pos", :default => 0, :null => false
+ t.integer "diff_total_pos", :default => 0, :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "bonus_points", ["user_id", "pool_id", "round_id"], :name => "index_bonus_points_on_user_id_and_pool_id_and_round_id", :unique => true
+
+ create_table "bonus_questions", :force => true do |t|
+ t.integer "round_id", :null => false
+ t.string "title", :null => false
+ t.integer "pos", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "bonus_rounds", :force => true do |t|
+ t.integer "pool_id", :null => false
+ t.string "title", :null => false
+ t.integer "pos", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "bonus_tips", :force => true do |t|
+ t.integer "user_id", :null => false
+ t.integer "question_id", :null => false
+ t.integer "pts", :default => 0, :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "event_quotes", :force => true do |t|
+ t.integer "service_id", :null => false
+ t.integer "event_id", :null => false
+ t.integer "team_id", :null => false
+ t.decimal "odds", :null => false
+ t.string "comments"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "events", :force => true do |t|
+ t.string "title", :null => false
+ t.string "key", :null => false
+ t.boolean "team3", :default => true, :null => false
+ t.datetime "start_at", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "events", ["key"], :name => "index_events_on_key", :unique => true
+
+ create_table "events_teams", :force => true do |t|
+ t.integer "event_id", :null => false
+ t.integer "team_id", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "events_teams", ["event_id", "team_id"], :name => "index_events_teams_on_event_id_and_team_id", :unique => true
+ add_index "events_teams", ["event_id"], :name => "index_events_teams_on_event_id"
+
+ create_table "games", :force => true do |t|
+ t.integer "round_id", :null => false
+ t.integer "pos", :null => false
+ t.integer "group_id"
+ t.integer "team1_id", :null => false
+ t.integer "team2_id", :null => false
+ t.datetime "play_at", :null => false
+ t.boolean "knockout", :default => false, :null => false
+ t.boolean "home", :default => true, :null => false
+ t.boolean "locked", :default => false, :null => false
+ t.integer "score1"
+ t.integer "score2"
+ t.integer "score3"
+ t.integer "score4"
+ t.integer "score5"
+ t.integer "score6"
+ t.integer "next_game_id"
+ t.integer "prev_game_id"
+ t.string "toto12x"
+ t.string "key"
+ t.string "type"
+ t.boolean "calc", :default => false, :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "games", ["group_id"], :name => "index_games_on_group_id"
+ add_index "games", ["key"], :name => "index_games_on_key", :unique => true
+ add_index "games", ["next_game_id"], :name => "index_games_on_next_game_id"
+ add_index "games", ["prev_game_id"], :name => "index_games_on_prev_game_id"
+ add_index "games", ["round_id"], :name => "index_games_on_round_id"
+
+ create_table "group_quotes", :force => true do |t|
+ t.integer "service_id", :null => false
+ t.integer "group_id", :null => false
+ t.integer "team_id", :null => false
+ t.decimal "odds", :null => false
+ t.string "comments"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "groups", :force => true do |t|
+ t.integer "event_id", :null => false
+ t.string "title", :null => false
+ t.integer "pos", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "groups", ["event_id"], :name => "index_groups_on_event_id"
+
+ create_table "groups_teams", :force => true do |t|
+ t.integer "group_id", :null => false
+ t.integer "team_id", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "groups_teams", ["group_id", "team_id"], :name => "index_groups_teams_on_group_id_and_team_id", :unique => true
+ add_index "groups_teams", ["group_id"], :name => "index_groups_teams_on_group_id"
+
+ create_table "plays", :force => true do |t|
+ t.integer "user_id", :null => false
+ t.integer "pool_id", :null => false
+ t.integer "team1_id"
+ t.integer "team2_id"
+ t.integer "team3_id"
+ t.integer "total_pts", :default => 0, :null => false
+ t.integer "total_pos", :default => 0, :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "plays", ["pool_id"], :name => "index_plays_on_pool_id"
+ add_index "plays", ["user_id", "pool_id"], :name => "index_plays_on_user_id_and_pool_id", :unique => true
+ add_index "plays", ["user_id"], :name => "index_plays_on_user_id"
+
+ create_table "points", :force => true do |t|
+ t.integer "user_id", :null => false
+ t.integer "pool_id", :null => false
+ t.integer "round_id", :null => false
+ t.integer "round_pts", :default => 0, :null => false
+ t.integer "round_pos", :default => 0, :null => false
+ t.integer "total_pts", :default => 0, :null => false
+ t.integer "total_pos", :default => 0, :null => false
+ t.integer "diff_total_pos", :default => 0, :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "points", ["user_id", "pool_id", "round_id"], :name => "index_points_on_user_id_and_pool_id_and_round_id", :unique => true
+
+ create_table "pools", :force => true do |t|
+ t.integer "event_id", :null => false
+ t.string "title", :null => false
+ t.integer "user_id", :null => false
+ t.boolean "fix", :default => false, :null => false
+ t.boolean "public", :default => true, :null => false
+ t.boolean "locked", :default => false, :null => false
+ t.text "welcome"
+ t.text "welcome_html"
+ t.string "key"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "pools", ["event_id"], :name => "index_pools_on_event_id"
+ add_index "pools", ["key"], :name => "index_pools_on_key", :unique => true
+ add_index "pools", ["user_id"], :name => "index_pools_on_user_id"
+
+ create_table "props", :force => true do |t|
+ t.string "key", :null => false
+ t.string "value", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "quotes", :force => true do |t|
+ t.integer "service_id", :null => false
+ t.integer "game_id", :null => false
+ t.decimal "odds1", :null => false
+ t.decimal "oddsx", :null => false
+ t.decimal "odds2", :null => false
+ t.string "comments"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "rounds", :force => true do |t|
+ t.integer "event_id", :null => false
+ t.string "title", :null => false
+ t.string "title2"
+ t.integer "pos", :null => false
+ t.boolean "playoff", :default => false, :null => false
+ t.boolean "flex", :default => true, :null => false
+ t.boolean "fix", :default => true, :null => false
+ t.string "type"
+ t.boolean "calc", :default => false, :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "rounds", ["event_id"], :name => "index_rounds_on_event_id"
+
+ create_table "services", :force => true do |t|
+ t.string "title", :null => false
+ t.string "key", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "teams", :force => true do |t|
+ t.string "title", :null => false
+ t.string "title2"
+ t.string "key", :null => false
+ t.string "img"
+ t.string "tag"
+ t.string "type"
+ t.boolean "calc", :default => false, :null => false
+ t.string "calc_rule"
+ t.string "calc_value"
+ t.integer "calc_team_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "teams", ["key"], :name => "index_teams_on_key", :unique => true
+
+ create_table "tips", :force => true do |t|
+ t.integer "user_id", :null => false
+ t.integer "pool_id", :null => false
+ t.integer "game_id", :null => false
+ t.integer "score1"
+ t.integer "score2"
+ t.integer "score3"
+ t.integer "score4"
+ t.integer "score5"
+ t.integer "score6"
+ t.string "toto12x"
+ t.string "type"
+ t.boolean "calc", :default => false, :null => false
+ t.integer "calc_team1_id"
+ t.integer "calc_team2_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "tips", ["game_id"], :name => "index_tips_on_game_id"
+ add_index "tips", ["pool_id"], :name => "index_tips_on_pool_id"
+ add_index "tips", ["user_id", "pool_id", "game_id"], :name => "index_tips_on_user_id_and_pool_id_and_game_id", :unique => true
+ add_index "tips", ["user_id"], :name => "index_tips_on_user_id"
+
+ create_table "users", :force => true do |t|
+ t.string "name", :null => false
+ t.string "email", :null => false
+ t.string "password_digest"
+ t.string "key", :null => false
+ t.boolean "admin", :default => false, :null => false
+ t.boolean "guest", :default => false, :null => false
+ t.boolean "active", :default => true, :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "users", ["email"], :name => "index_users_on_email", :unique => true
+ add_index "users", ["key"], :name => "index_users_on_key", :unique => true
+
+end
View
7 db/seeds.rb
@@ -1,5 +1,12 @@
+SportDB.load([
+ 'cl/teams',
+ 'cl/2012_13/cl',
+ 'euro/teams',
+ 'world/quali_2012_13'
+ ])
+
['services',
'cl/teams', 'cl/2012_13/cl', 'cl/2012_13/cl_quotes',
'euro/teams', 'world/quali_2012_13',
View
1  db/seeds/at/2011_12/bl.rb
@@ -0,0 +1 @@
+## nothing here
View
3  db/seeds/at/2011_12/cup.rb
@@ -0,0 +1,3 @@
+
+
+Event.find_by_key!( 'at_cup_2011_12' ).update_attributes!( :team3 => false )
View
1  db/seeds/at/2012_13/bl.rb
@@ -0,0 +1 @@
+## nothing here
View
0  db/seeds/austria/2012_13/bl_quotes.rb → db/seeds/at/2012_13/bl_quotes.rb
File renamed without changes
View
5 db/seeds/at/2012_13/cup.rb
@@ -0,0 +1,5 @@
+
+
+Event.find_by_key!( 'at_cup_2012_13' ).update_attributes!( :team3 => false )
+
+
View
0  db/seeds/austria/2012_13/cup_2.rb → db/seeds/at/2012_13/cup_2.rb
File renamed without changes
View
0  db/seeds/austria/2012_13/cup_quotes.rb → db/seeds/at/2012_13/cup_quotes.rb
File renamed without changes
View
0  db/seeds/austria/teams.rb → db/seeds/at/teams.rb
File renamed without changes
View
1  db/seeds/austria/2011_12/bl.rb
@@ -1 +0,0 @@
-## delete me - nothing here
View
6 db/seeds/austria/2011_12/cup.rb
@@ -1,6 +0,0 @@
-
-
-### todo:
-## update event
-## add :team3 flag
-## ofb = Event.create!( :key => 'at_cup_2011_12', :title => 'ÖFB Cup 2011/12', :team3 => false, :start_at => Time.cet( '2011-10-10 17:00' ) )
View
1  db/seeds/austria/2012_13/bl.rb
@@ -1 +0,0 @@
-## nothing delete me
View
10 db/seeds/austria/2012_13/cup.rb
@@ -1,10 +0,0 @@
-
-
-##
-## todo: update team3 flag
-
-## cup = Event.create!( :key => 'at_cup_2012_13',
-# :title => 'ÖFB Cup 2012/13',
-# :team3 => false,
-# :start_at => Time.cet( '2012-07-13 00:00' ) )
-
View
7 db/seeds/cl/2011_12/cl.rb
@@ -2,13 +2,8 @@
## note :team3 => false CL has no 3rd place (only final game)
-##
-## fix: team3 => false
-# cl = Event.create!( :key => 'cl',
-# :title => 'Champions League 2011/12',
-# :team3 => false,
-# :start_at => Time.cet( '2011-10-10 17:00' ) )
+Event.find_by_key!( 'cl' ).update_attributes!( :team3 => false )
Prop.create!( :key => 'db.cl.2011/12.2.version', :value => '1' )
View
9 db/seeds/cl/2011_12/el.rb
@@ -1,11 +1,6 @@
# encoding: utf-8
-##
-## fix: team3 => false
-#
-#el = Event.create!( :key => 'el',
-# :title => 'Europa League 2011/12',
-# :team3 => false,
-# :start_at => Time.cet( '2011-10-10 17:00' ))
+Event.find_by_key!( 'el' ).update_attributes!( :team3 => false )
+
Prop.create!( :key => 'db.el.2011/12.2.version', :value => '1' )
View
7 db/seeds/cl/2012_13/cl.rb
@@ -1,14 +1,9 @@
# encoding: utf-8
-# todo/fix: team3 => false
-
## note :team3 => false CL has no 3rd place (only final game)
-#cl = Event.create!( :key => 'cl.2012/13',
-# :title => 'Champions League 2012/13',
-# :team3 => false,
-# :start_at => Time.cet( '2012-09-18 18:30' ) )
+Event.find_by_key!( 'cl.2012/13' ).update_attributes!( :team3 => false )
Prop.create!( :key => 'db.cl.2012/13.2.version', :value => '1' )
View
2  db/seeds/cl/teams.rb
@@ -2,7 +2,7 @@
teams = [
- [ 'porto' 'cl/porto.png' ],
+ [ 'porto', 'cl/porto.png' ],
[ 'kiew', 'cl/kiew.png' ],
[ 'paris', 'cl/paris.png' ],
[ 'zagreb', 'cl/zagreb.png' ],
View
2  db/seeds/demo/pools.rb
@@ -1,7 +1,5 @@
# encoding: utf-8
-puts "*** loading seed data in seeds/demo/pools.rb"
-
lionel = User.find_by_key!( 'lionel' )
cristiano = User.find_by_key!( 'cristiano' )
View
2  db/seeds/demo/users.rb
@@ -1,7 +1,5 @@
# encoding: utf-8
-puts "*** loading seed data in seeds/demo/users.rb"
-
##############
## Users
View
9 db/seeds/euro/2012.rb
@@ -1,12 +1,9 @@
# encoding: utf-8
-### fix/todo:
-## team3 => false
-#euro = Event.create!( :key => 'euro',
-# :title => 'Euro 2012',
-# :team3 => false,
-# :start_at => Time.cet( '2012-06-07 17:00' ))
+
+euro = Event.find_by_key!( 'euro' )
+euro.update_attributes!( :team3 => false )
View
2  db/seeds/mexico/apertura_2012.rb
@@ -1,2 +0,0 @@
-
-## nothing; delete me
View
2  db/seeds/mx/apertura_2012.rb
@@ -0,0 +1,2 @@
+
+## nothing here
View
0  db/seeds/mexico/teams.rb → db/seeds/mx/teams.rb
File renamed without changes
View
2  db/seeds/ro/l1_2012_13.rb
@@ -0,0 +1,2 @@
+## nothing here
+
View
0  db/seeds/romania/teams.rb → db/seeds/ro/teams.rb
File renamed without changes
View
2  db/seeds/romania/l1_2012_13.rb
@@ -1,2 +0,0 @@
-## nothing; delete me
-
View
2  db/seeds/services.rb
@@ -1,7 +1,5 @@
# encoding: utf-8
-puts "*** loading seed data in seeds/services.rb"
-
Service.create!( :key => 'tipp3', :title => 'tipp3' ) # tipp3 classic
Service.create!( :key => 'tipico', :title => 'tipico' )
Service.create!( :key => 'betathome', :title => 'bet-at-home' )
View
2  db/seeds/uss/others_pools.rb
@@ -1,7 +1,5 @@
# encoding: utf-8
-puts "*** loading seed data in seeds/uss/pools_others.rb"
-
##############
## Pools
View
2  db/seeds/uss/users.rb
@@ -1,7 +1,5 @@
# encoding: utf-8
-puts "*** loading seed data in seeds/uss/users.rb"
-
##############
# Users
View
2  db/seeds/world/quali_2012_13.rb
@@ -1,2 +1,2 @@
-# nothing; delete me
+# nothing here
View
2  db/seeds/world/quali_2012_13_2.rb
@@ -1,7 +1,5 @@
# encoding: utf-8
-puts "*** loading seed data in seeds/world/quali_2012_13_2.rb"
-
#################################3
# Gruppe C
View
19 lib/tasks/load_uss_others.rake
@@ -1,11 +1,22 @@
desc "wettpool: load seed data for uss other pools"
task :load_uss_others => [:environment] do |t|
+
+
+ SportDB.load([
+ 'at/teams',
+ 'at/2012_13/bl',
+ 'at/2012_13/cup',
+ 'euro/teams',
+ 'world/quali_2012_13',
+ 'cl/teams',
+ 'cl/2012_13/cl'
+ ])
['services',
- 'austria/teams',
- 'austria/2012_13/bl', 'austria/2012_13/bl_quotes',
- 'austria/2012_13/cup', 'austria/2012_13/cup_quotes',
+ 'at/teams',
+ 'at/2012_13/bl', 'at/2012_13/bl_quotes',
+ 'at/2012_13/cup', 'at/2012_13/cup_quotes',
'euro/teams', 'world/quali_2012_13',
'cl/teams', 'cl/2012_13/cl', 'cl/2012_13/cl_quotes',
'uss/users', 'uss/others_pools' ].each do |seed|
@@ -19,7 +30,7 @@ end
desc "wettpool: load more seed data for bl cup 2 pool"
task :load_cup_ii => [:environment] do |t|
- [ 'austria/2012_13/cup_2' ].each do |seed|
+ [ 'at/2012_13/cup_2' ].each do |seed|
puts "*** loading seed data in '#{seed}'..."
require "#{Rails.root}/db/seeds/#{seed}.rb"
end
Please sign in to comment.
Something went wrong with that request. Please try again.