Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update seeds

  • Loading branch information...
commit a9dbc7b52afa48433080c4bd56b76c536254742c 1 parent 36f7fb9
@geraldb geraldb authored
View
4 app/helpers/part_helper.rb
@@ -91,9 +91,11 @@ def render_tip_score_v2( tip, opts={} )
show_tips = opts[:show_tips].present? ? opts[:show_tips] : true # default true
show_pts = opts[:show_pts].present? ? opts[:show_pts] : false # default false
+ ## todo/fix: how to deal w/ missing tip - tip.nil?
+
render :partial => 'shared/td_tip_score_v2',
:locals => { :tip => tip,
- :game => tip.game,
+ :game => (tip.present? ? tip.game : nil),
:show_tips => show_tips,
:show_pts => show_pts }
end
View
4 app/views/plays/edit.html.erb
@@ -125,8 +125,8 @@
-
-<%= form_for @play, :url => play_path( @play ), :html => { :method => 'put' } do |f| %>
+ <!-- NB: namespaced model gets converted to sportsdb_models_play but only want user in params, thus, use as: option -->
+<%= form_for @play, :as => :play, :url => play_path( @play ), :html => { :method => 'put' } do |f| %>
<!-- todo/fix:
View
4 app/views/plays/index.html.erb
@@ -102,8 +102,8 @@
<%= render_game_team1( game ) %>
<% @users.each do |user| %>
- <!-- fix: use _and_game! - to raise excep if find fails -->
- <% tip = Tip.find_by_user_and_pool_and_game( user, @pool, game ) %>
+ <!-- NB: allow missing tip, that is, tip.nil? true !!! -->
+ <% tip = Tip.find_by_user_id_and_pool_id_and_game_id( user.id, @pool.id, game.id ) %>
<%= render_tip_score_v2( tip, :show_tips => @show_tips, :show_pts => @show_pts ) %>
<% end %><!-- users.each -->
View
3  app/views/sessions/new.html.erb
@@ -17,7 +17,8 @@
<td><!-- begin 2nd column -->
-<%= form_for @user, :url => session_path() do |f| %>
+ <!-- NB: namespaced model gets converted to sportsdb_models_user but only want user in params, thus, use as: option -->
+<%= form_for @user, :as => :user, :url => session_path() do |f| %>
<div style='padding: 20px; background-color: #F1F1F1;'>
<div>
View
800 db/schema.rb
@@ -1,400 +1,400 @@
-# 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 => 1) 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 "badges", :force => true do |t|
- t.integer "team_id", :null => false
- t.integer "league_id", :null => false
- t.integer "season_id", :null => false
- t.string "title", :null => false
- 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 "cities", :force => true do |t|
- t.string "title", :null => false
- t.string "key", :null => false
- t.string "code"
- t.string "synonyms"
- t.integer "country_id", :null => false
- t.integer "region_id"
- t.integer "pop"
- t.integer "area"
- t.boolean "capital", :default => false, :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "countries", :force => true do |t|
- t.string "title", :null => false
- t.string "key", :null => false
- t.string "code", :null => false
- t.string "synonyms"
- t.string "motor"
- t.integer "pop"
- t.integer "area"
- 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 "key", :null => false
- t.integer "league_id", :null => false
- t.integer "season_id", :null => false
- t.datetime "start_at", :null => false
- t.datetime "end_at"
- t.boolean "team3", :default => true, :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.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.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.boolean "locked", :default => false, :null => false
- t.string "type"
- t.boolean "calc", :default => false, :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 "leagues", :force => true do |t|
- t.string "key", :null => false
- t.string "title", :null => false
- t.integer "country_id"
- t.boolean "club", :default => false, :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- 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 "public", :default => true, :null => false
- t.boolean "locked", :default => false, :null => false
- t.string "key"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.boolean "fix", :default => false, :null => false
- t.text "welcome"
- t.text "welcome_html"
- 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 "regions", :force => true do |t|
- t.string "title", :null => false
- t.string "key", :null => false
- t.string "synonyms"
- t.integer "country_id", :null => false
- t.integer "pop"
- t.integer "area"
- 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 "knockout", :default => false, :null => false
- t.datetime "start_at", :null => false
- t.datetime "end_at"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :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
- end
-
- add_index "rounds", ["event_id"], :name => "index_rounds_on_event_id"
-
- create_table "seasons", :force => true do |t|
- t.string "key", :null => false
- t.string "title", :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- 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 "taggings", :force => true do |t|
- t.integer "tag_id", :null => false
- t.integer "taggable_id"
- t.string "taggable_type"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id"
- add_index "taggings", ["taggable_id", "taggable_type"], :name => "index_taggings_on_taggable_id_and_taggable_type"
-
- create_table "tags", :force => true do |t|
- t.string "key", :null => false
- t.string "title"
- 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 "code"
- t.string "synonyms"
- t.integer "country_id", :null => false
- t.integer "city_id"
- t.boolean "club", :default => false, :null => false
- t.boolean "national", :default => false, :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "img"
- t.string "type"
- t.boolean "calc", :default => false, :null => false
- t.string "calc_rule"
- t.string "calc_value"
- t.integer "calc_team_id"
- 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.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "type"
- t.boolean "calc", :default => false, :null => false
- t.integer "calc_team1_id"
- t.integer "calc_team2_id"
- 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 "key", :null => false
- t.string "name", :null => false
- t.string "email", :null => false
- t.string "password_digest"
- 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 => 1) 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 "badges", :force => true do |t|
+ t.integer "team_id", :null => false
+ t.integer "league_id", :null => false
+ t.integer "season_id", :null => false
+ t.string "title", :null => false
+ 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 "cities", :force => true do |t|
+ t.string "title", :null => false
+ t.string "key", :null => false
+ t.string "code"
+ t.string "synonyms"
+ t.integer "country_id", :null => false
+ t.integer "region_id"
+ t.integer "pop"
+ t.integer "area"
+ t.boolean "capital", :default => false, :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "countries", :force => true do |t|
+ t.string "title", :null => false
+ t.string "key", :null => false
+ t.string "code", :null => false
+ t.string "synonyms"
+ t.string "motor"
+ t.integer "pop"
+ t.integer "area"
+ 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 "key", :null => false
+ t.integer "league_id", :null => false
+ t.integer "season_id", :null => false
+ t.datetime "start_at", :null => false
+ t.datetime "end_at"
+ t.boolean "team3", :default => true, :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.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.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.boolean "locked", :default => false, :null => false
+ t.string "type"
+ t.boolean "calc", :default => false, :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 "leagues", :force => true do |t|
+ t.string "key", :null => false
+ t.string "title", :null => false
+ t.integer "country_id"
+ t.boolean "club", :default => false, :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ 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 "public", :default => true, :null => false
+ t.boolean "locked", :default => false, :null => false
+ t.string "key"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.boolean "fix", :default => false, :null => false
+ t.text "welcome"
+ t.text "welcome_html"
+ 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 "regions", :force => true do |t|
+ t.string "title", :null => false
+ t.string "key", :null => false
+ t.string "synonyms"
+ t.integer "country_id", :null => false
+ t.integer "pop"
+ t.integer "area"
+ 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 "knockout", :default => false, :null => false
+ t.datetime "start_at", :null => false
+ t.datetime "end_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :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
+ end
+
+ add_index "rounds", ["event_id"], :name => "index_rounds_on_event_id"
+
+ create_table "seasons", :force => true do |t|
+ t.string "key", :null => false
+ t.string "title", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ 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 "taggings", :force => true do |t|
+ t.integer "tag_id", :null => false
+ t.integer "taggable_id"
+ t.string "taggable_type"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id"
+ add_index "taggings", ["taggable_id", "taggable_type"], :name => "index_taggings_on_taggable_id_and_taggable_type"
+
+ create_table "tags", :force => true do |t|
+ t.string "key", :null => false
+ t.string "title"
+ 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 "code"
+ t.string "synonyms"
+ t.integer "country_id", :null => false
+ t.integer "city_id"
+ t.boolean "club", :default => false, :null => false
+ t.boolean "national", :default => false, :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "img"
+ t.string "type"
+ t.boolean "calc", :default => false, :null => false
+ t.string "calc_rule"
+ t.string "calc_value"
+ t.integer "calc_team_id"
+ 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.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "type"
+ t.boolean "calc", :default => false, :null => false
+ t.integer "calc_team1_id"
+ t.integer "calc_team2_id"
+ 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 "key", :null => false
+ t.string "name", :null => false
+ t.string "email", :null => false
+ t.string "password_digest"
+ 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
33 db/seeds.rb
@@ -9,19 +9,28 @@
SportDB.load([
'leagues',
- 'seasons',
- 'de/teams',
- 'en/teams',
- 'es/teams',
- 'cl/teams',
+ 'seasons'
+ ])
+
+ de = WorldDB::Models::Country.find_by_key!( 'de' )
+ en = WorldDB::Models::Country.find_by_key!( 'en' )
+ es = WorldDB::Models::Country.find_by_key!( 'es' )
+
+ SportDB.read([
+ [ 'euro/teams', { national: true } ],
+ [ 'de/teams', { club: true, country_id: de.id } ],
+ [ 'en/teams', { club: true, country_id: en.id } ],
+ [ 'es/teams', { club: true, country_id: es.id } ],
+ [ 'cl/teams', { club: true } ]
+ ])
+
+ SportDB.load([
'cl/2012_13/cl',
- 'euro/teams',
- 'world/quali_2012_13_europe',
- 'world/quali_2012_13_europe_c'
+ 'world/quali_2012_13_europe'
])
SportDB.read([
- ['wmq.euro', 'world/quali_2012_13_europe_c']
+ ['world.quali.euro.2012/13', 'world/quali_2012_13_europe_c']
])
SportDB::Market.load( [
@@ -30,9 +39,9 @@
])
SportDB::Market.read( [
- [ 'tipp3', 'cl.2012/13', 'cl/2012_13/cl_tipp3' ],
- [ 'betathome', 'cl.2012/13', 'cl/2012_13/cl_betathome' ],
- [ 'tipp3', 'wmq.euro', 'world/quali_tipp3' ]
+ [ 'tipp3', 'cl.2012/13', 'cl/2012_13/cl_tipp3' ],
+ [ 'betathome', 'cl.2012/13', 'cl/2012_13/cl_betathome' ],
+ [ 'tipp3', 'world.quali.euro.2012/13', 'world/quali_tipp3' ]
])
['cl/teams', 'euro/teams',
View
4 db/seeds/setups/demo/pools.rb
@@ -6,9 +6,9 @@
demo = User.find_by_key!( 'demo' )
-wmq = Event.find_by_key!( 'wmq.euro' )
+worldq = Event.find_by_key!( 'world.quali.euro.2012/13' )
-pool1 = Pool.create!( event: wmq, title: 'Demo', user: lionel, welcome: '' )
+pool1 = Pool.create!( event: worldq, title: 'Demo', user: lionel, welcome: '' )
pool1.players << lionel # also auto add admin as first player
pool1.players << demo
Please sign in to comment.
Something went wrong with that request. Please try again.