Permalink
Browse files

cleanup db:seed

  • Loading branch information...
1 parent be6e4d9 commit 06f5c58ada310231c49cba13a1cf5309bccd4abe @geraldb geraldb committed Nov 18, 2012
Showing with 22 additions and 7 deletions.
  1. +1 −1 Gemfile
  2. +2 −2 Gemfile.lock
  3. +11 −1 db/seeds.rb
  4. +8 −3 lib/tasks/load_quotes.rake
View
@@ -9,7 +9,7 @@ gem 'rails-i18n' # see https://github.com/svenfuchs/rails-i18n
gem 'sportdb', '0.8.1' # see https://github.com/geraldb/sport.db
### todo/fix: make it work w/ autoload - will sportdb/market work?
-gem 'sportdb-market', '0.0.9', require: 'sportdb/market/market'
+gem 'sportdb-market', '0.1.1', require: 'sportdb/market/market'
group :production do
gem 'pg'
View
@@ -100,7 +100,7 @@ GEM
sportdb (0.8.1)
activerecord (~> 3.2)
worlddb (~> 0.3.2)
- sportdb-market (0.0.9)
+ sportdb-market (0.1.1)
sprockets (2.1.2)
hike (~> 1.2)
rack (~> 1.0)
@@ -140,7 +140,7 @@ DEPENDENCIES
ri_cal
sass-rails (~> 3.2.3)
sportdb (= 0.8.1)
- sportdb-market (= 0.0.9)
+ sportdb-market (= 0.1.1)
sqlite3
thin
uglifier (>= 1.0.3)
View
@@ -24,7 +24,17 @@
['wmq.euro', 'world/quali_2012_13_europe_c']
])
-
+ SportDB::Market.load( [
+ 'services',
+ 'cl/2012_13/cl'
+ ])
+
+ 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' ]
+ ])
+
['cl/teams', 'euro/teams',
'setups/demo/users', 'setups/demo/pools'].each do |seed|
puts "*** loading seed data in '#{seed}'..."
View
@@ -1,14 +1,19 @@
desc "sportbook: stats/debug"
task :sportbook_stats => [:environment] do |t|
- puts "SportDB.banner: >>#{SportDB.banner}<<"
- puts "SportDB.root: >>#{SportDB.root}<<"
+ puts "[debug] SportDB.banner: >>#{SportDB.banner}<<"
+ puts "[debug] SportDB.root: >>#{SportDB.root}<<"
+
+ puts "[debug] SportDB::Market.banner: >>#{SportDB::Market.banner}<<"
+ puts "[debug] SportDB::Market.root: >>#{SportDB::Market.root}<<"
end
desc "sportbook: load quotes (e.g. bl_quotes_tipp3.txt)"
task :load_quotes => [:environment] do |t|
+ SportDB::Market.delete! ## danger zone!! delete all market tables (quotes,etc.)
+
SportDB::Market.load( [
'services',
'cl/2012_13/cl',
@@ -23,7 +28,7 @@ task :load_quotes => [:environment] do |t|
#[ 'betathome', 'at_cup_2012_13', 'at/2012_13/cup_betathome' ],
[ 'tipp3', 'cl.2012/13', 'cl/2012_13/cl_tipp3' ],
[ 'betathome', 'cl.2012/13', 'cl/2012_13/cl_betathome' ],
- # [ 'tipp3', 'wmq', 'world/quali_tipp3' ]
+ [ 'tipp3', 'wmq.euro', 'world/quali_tipp3' ]
])
end

0 comments on commit 06f5c58

Please sign in to comment.