Permalink
Browse files

Merge branch 'master' of github.com:geraldb/wettpool

  • Loading branch information...
2 parents 469835c + 7ea7ebd commit 38b08b5b968dc89dbe41c8df7b86485fa007d8d5 @geraldb geraldb committed Jul 15, 2012
View
BIN app/assets/images/ro/astra_ploiesti.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/ro/ceahlau.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/ro/cfr_cluj.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/ro/concordia_chiajna.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/ro/csms_iasi.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/ro/dinamo.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/ro/fcbrasov.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/ro/gazmetan_medias.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/ro/gazmetan_severin.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/ro/gloria_bistrita.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/ro/otelul.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/ro/pandurii.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/ro/petrolul.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/ro/rapid.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/ro/steaua.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/ro/u_cluj.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/ro/vaslui.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/ro/viitorul_constanta.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2 app/models/team.rb
@@ -43,7 +43,7 @@ def self.create_from_ary!( teams )
if value.length == 3 ## assume its a tag (three latters)
attr[ :tag ] = value
## fix: use a regex pattern?
- elsif value.include?( '.png' ) || value.include?( '.jpg' ) ## assume its a img
+ elsif value.include?( '.png' ) || value.include?( '.jpg' ) || value.include?( '.gif' ) ## assume its a img
attr[ :img ] = value
else
attr[ :title2 ] = value
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
134 db/seeds/romania/l1_2012_13.rb
@@ -0,0 +1,134 @@
+# encoding: utf-8
+
+# note: timezone for games (play_at) is *always* eet (eastern european time)
+
+
+puts "*** loading seed data in seeds/romania/l1_2012_13.rb"
+
+######################################
+## Romania Liga1 2012/13
+##
+## more info => http://liga1.ro
+
+
+l1 = Event.create!( :key => 'ro_l1_2012_13',
+ :title => 'Romania Liga 1 2012/13',
+ :start_at => Time.eet('2012-07-01 00:00') )
+
+astra = Team.find_by_key!( 'astra' )
+ceahlau = Team.find_by_key!( 'ceahlau' )
+cfr = Team.find_by_key!( 'cfr' )
+chiajna = Team.find_by_key!( 'chiajna' )
+iasi = Team.find_by_key!( 'iasi' )
+dinamo = Team.find_by_key!( 'dinamo' )
+fcbrasov = Team.find_by_key!( 'fcbrasov' )
+gazmetan_severin = Team.find_by_key!( 'gazmetan_severin' )
+vaslui = Team.find_by_key!( 'vaslui' )
+gazmetan_medias = Team.find_by_key!( 'gazmetan_medias' )
+gloria_bistrita = Team.find_by_key!( 'gloria_bistrita' )
+otelul = Team.find_by_key!( 'otelul' )
+pandurii = Team.find_by_key!( 'pandurii' )
+petrolul = Team.find_by_key!( 'petrolul' )
+rapid = Team.find_by_key!( 'rapid' )
+steaua = Team.find_by_key!( 'steaua' )
+u_cluj = Team.find_by_key!( 'u_cluj' )
+viitorul_constanta = Team.find_by_key!( 'viitorul_constanta' )
+
+
+l1.teams << astra
+l1.teams << ceahlau
+l1.teams << cfr
+l1.teams << chiajna
+l1.teams << iasi
+l1.teams << dinamo
+l1.teams << fcbrasov
+l1.teams << gazmetan_severin
+l1.teams << vaslui
+l1.teams << gazmetan_medias
+l1.teams << gloria_bistrita
+l1.teams << otelul
+l1.teams << pandurii
+l1.teams << petrolul
+l1.teams << rapid
+l1.teams << steaua
+l1.teams << u_cluj
+l1.teams << viitorul_constanta
+
+
+l101 = Round.create!( :event => l1, :pos => 1, :title => '1. Runda' )
+l102 = Round.create!( :event => l1, :pos => 2, :title => '2. Runda' )
+l103 = Round.create!( :event => l1, :pos => 3, :title => '3. Runda' )
+l104 = Round.create!( :event => l1, :pos => 4, :title => '4. Runda' )
+l105 = Round.create!( :event => l1, :pos => 5, :title => '5. Runda' )
+
+
+games_l101 = [
+ [ 1, pandurii, [], u_cluj, Time.eet('2012-07-20 18:30') ],
+ [ 2, gazmetan_medias, [], dinamo, Time.eet('2012-07-20 20:20') ],
+ [ 3, petrolul, [], ceahlau, Time.eet('2012-07-21 19:00') ],
+ [ 4, cfr, [], gazmetan_severin, Time.eet('2012-07-21 21:30') ],
+ [ 5, iasi, [], otelul, Time.eet('2012-07-22 19:00') ],
+ [ 6, gloria_bistrita, [], astra, Time.eet('2012-07-22 19:00') ],
+ [ 7, rapid, [], vaslui, Time.eet('2012-07-22 21:30') ],
+ [ 8, viitorul_constanta, [], fcbrasov, Time.eet('2012-07-23 19:00') ],
+ [ 9, steaua, [], chiajna, Time.eet('2012-07-23 21:30') ]
+]
+
+games_l102 = [
+ [ 1, chiajna, [], viitorul_constanta, Time.eet('2012-07-28 18:30') ],
+ [ 2, fcbrasov, [], gazmetan_severin, Time.eet('2012-07-28 20:20') ],
+ [ 3, dinamo, [], iasi, Time.eet('2012-07-29 19:00') ],
+ [ 4, otelul, [], rapid, Time.eet('2012-07-29 21:30') ],
+ [ 5, ceahlau, [], cfr, Time.eet('2012-07-30 19:00') ],
+ [ 6, vaslui, [], petrolul, Time.eet('2012-07-30 19:00') ],
+ [ 7, gazmetan_medias, [], pandurii, Time.eet('2012-07-30 21:30') ],
+ [ 8, u_cluj, [], gloria_bistrita, Time.eet('2012-07-31 19:00') ],
+ [ 9, astra, [], steaua, Time.eet('2012-07-31 21:30') ]
+]
+
+games_l103 = [
+ [ 1, steaua, [], u_cluj, Time.eet('2012-08-03 18:30') ],
+ [ 2, viitorul_constanta, [], astra, Time.eet('2012-08-03 20:20') ],
+ [ 3, gazmetan_severin, [], chiajna, Time.eet('2012-08-04 19:00') ],
+ [ 4, petrolul, [], otelul, Time.eet('2012-08-04 21:30') ],
+ [ 5, rapid, [], iasi, Time.eet('2012-08-05 19:00') ],
+ [ 6, cfr, [], vaslui, Time.eet('2012-08-05 19:00') ],
+ [ 7, pandurii, [], vaslui, Time.eet('2012-08-05 21:30') ],
+ [ 8, gloria_bistrita, [], gazmetan_medias, Time.eet('2012-08-06 19:00') ],
+ [ 9, fcbrasov, [], dinamo, Time.eet('2012-08-06 21:30') ]
+]
+
+games_l104 = [
+ [ 1, iasi, [], petrolul, Time.eet('2012-08-11 18:30') ],
+ [ 2, chiajna, [], fcbrasov, Time.eet('2012-08-11 20:20') ],
+ [ 3, dinamo, [], rapid, Time.eet('2012-08-12 19:00') ],
+ [ 4, otelul, [], cfr, Time.eet('2012-08-12 21:30') ],
+ [ 5, ceahlau, [], gloria_bistrita, Time.eet('2012-08-13 19:00') ],
+ [ 6, vaslui, [], pandurii, Time.eet('2012-08-13 19:00') ],
+ [ 7, gazmetan_medias, [], steaua, Time.eet('2012-08-13 21:30') ],
+ [ 8, u_cluj, [], viitorul_constanta, Time.eet('2012-08-14 19:00') ],
+ [ 9, astra, [], gazmetan_severin, Time.eet('2012-08-14 21:30') ]
+]
+
+games_l105 = [
+ [ 1, steaua, [], ceahlau, Time.eet('2012-08-18 18:30') ],
+ [ 2, viitorul_constanta, [], gazmetan_medias, Time.eet('2012-08-18 20:20') ],
+ [ 3, gazmetan_severin, [], u_cluj, Time.eet('2012-08-19 19:00') ],
+ [ 4, petrolul, [], rapid, Time.eet('2012-08-19 21:30') ],
+ [ 5, cfr, [], iasi, Time.eet('2012-08-20 19:00') ],
+ [ 6, pandurii, [], otelul, Time.eet('2012-08-20 19:00') ],
+ [ 7, gloria_bistrita, [], vaslui, Time.eet('2012-08-20 21:30') ],
+ [ 8, chiajna, [], dinamo, Time.eet('2012-08-21 19:00') ],
+ [ 9, fcbrasov, [], astra, Time.eet('2012-08-21 21:30') ]
+]
+
+
+Game.create_from_ary!( games_l101, l101 )
+Game.create_from_ary!( games_l102, l102 )
+Game.create_from_ary!( games_l103, l103 )
+Game.create_from_ary!( games_l104, l104 )
+Game.create_from_ary!( games_l105, l105 )
+
+
+## todo: use new version constant for app module e.g. Wettpool::VERSION ??
+Prop.create!( :key => 'db.seeds.romania.l1.2012/13.version', :value => '1' )
View
30 db/seeds/romania/teams.rb
@@ -0,0 +1,30 @@
+# encoding: utf-8
+
+puts "*** loading seed data in seeds/romania/teams.rb"
+
+
+l1 = [
+ [ 'astra', 'Astra Ploiesti', 'AFC', 'ro/astra_ploiesti.gif' ],
+ [ 'ceahlau', 'Ceahlaul Piatra Neamt', 'FCC', 'ro/rapid.gif' ],
+ [ 'cfr', 'CFR Cluj', 'CFR', 'ro/cfr_cluj.gif' ],
+ [ 'chiajna', 'Concordia Chiajna', 'CCH', 'ro/concordia_chiajna.gif' ],
+ [ 'iasi', 'CSMS Iasi', 'CSI', 'ro/csms_iasi.gif' ],
+ [ 'dinamo', 'Dinamo Bucuresti', 'FCD', 'ro/dinamo.gif' ],
+ [ 'fcbrasov', 'FC Brasov', 'FCB', 'ro/fcbrasov.gif' ],
+ [ 'gazmetan_severin', 'FC Severin', 'FCS', 'ro/gazmetan_severin.gif' ],
+ [ 'vaslui', 'FC Vaslui', 'FCV', 'ro/vaslui.gif' ],
+ [ 'gazmetan_medias', 'Gaz Metan Medias', 'GMM', 'ro/gazmetan_medias.gif' ],
+ [ 'gloria_bistrita', 'Gloria Bistrita', 'GBS', 'ro/gloria_bistrita.gif' ],
+ [ 'otelul', 'Otelul Galati', 'OTG', 'ro/otelul.gif' ],
+ [ 'pandurii', 'Pandurii Tg Jiu', 'PTJ', 'ro/pandurii.gif' ],
+ [ 'petrolul', 'Petrolul Ploiesti', 'PPL', 'ro/petrolul.gif' ],
+ [ 'rapid', 'Rapid Bucuresti', 'RBU', 'ro/rapid.gif' ],
+ [ 'steaua', 'Steaua Bucuresti', 'SBU', 'ro/steaua.gif' ],
+ [ 'u_cluj', 'U Cluj', 'UCJ', 'ro/u_cluj.gif' ],
+ [ 'viitorul_constanta', 'Viitorul Constanta', 'VCT', 'ro/viitorul_constanta.gif' ]
+]
+
+Team.create_from_ary!( l1 )
+
+## todo: use new version constant for app module e.g. Wettpool::VERSION ??
+Prop.create!( :key => 'db.seeds.romania.teams.version', :value => '1' )
View
15 db/seeds/ussr/pools.rb
@@ -0,0 +1,15 @@
+# encoding: utf-8
+
+puts "*** loading seed data in seeds/ussr/pools.rb"
+
+##############
+## Pools
+
+ro_l1 = Event.find_by_key!( 'ro_l1_2012_13' )
+
+aurel = User.find_by_key!( 'aurel' )
+
+Pool.create!( :event => ro_l1, :title => 'USS', :user => aurel, :welcome => '' )
+
+## todo: use new version constant for app module e.g. Wettpool::VERSION ??
+Prop.create!( :key => 'db.seeds.ussr.pools.others.version', :value => '1' )
View
30 db/seeds/ussr/users.rb
@@ -0,0 +1,30 @@
+# encoding: utf-8
+
+puts "*** loading seed data in seeds/ussr/users.rb"
+
+##############
+# Users
+
+users = [
+ [ 'Borovsky I', 'istvan' ],
+ [ 'Bozga M', 'marius' ],
+ [ 'Chindea S', 'simona' ],
+ [ 'Cosma O', 'ovidiu' ],
+ [ 'Costea N', 'nicoleta' ],
+ [ 'Deac A', 'aurel', { :admin => true } ],
+ [ 'Grebisan M', 'mihai' ],
+ [ 'Isoc R', 'ramona' ],
+ [ 'Oltean N', 'nicolae' ],
+ [ 'Padurean R', 'razvan' ],
+ [ 'Pal E', 'eniko' ],
+ [ 'Petraru M', 'monica' ],
+ [ 'Sinca R', 'raluca' ],
+ [ 'Sipos R', 'radu' ],
+ [ 'Szasz I', 'ciobi', { :admin => true } ],
+ [ 'Timoc V', 'virgil', { :admin => true } ]
+]
+
+User.create_from_ary!( users )
+
+## todo: use new version constant for app module e.g. Wettpool::VERSION ??
+Prop.create!( :key => 'db.seeds.ussr.users.version', :value => '1' )
View
12 lib/tasks/load_ussr.rake
@@ -0,0 +1,12 @@
+
+desc "wettpool: load seed data for ussr pools"
+task :load_ussr => [:environment] do |t|
+
+ ['services',
+ 'romania/teams', 'romania/l1_2012_13',
+ 'ussr/users', 'ussr/pools'
+ ].each do |seed|
+ require "#{Rails.root}/db/seeds/#{seed}.rb"
+ end
+
+end
View
4 lib/utils.rb
@@ -4,6 +4,10 @@ class Time
def self.cet( str ) # central european time (cet) + central european summer time (cest)
ActiveSupport::TimeZone['Vienna'].parse( str )
end
+
+ def self.eet( str ) # eastern european time (eet) + 2 hours
+ ActiveSupport::TimeZone['Bucharest'].parse( str )
+ end
def self.cst( str ) # central standard time (cst) - 6 hours
ActiveSupport::TimeZone['Mexico City'].parse( str )

0 comments on commit 38b08b5

Please sign in to comment.