2012-03-05 14:42:09 +00:00
|
|
|
namespace :maps do
|
2012-03-07 05:11:05 +00:00
|
|
|
desc 'Seed the maps!'
|
|
|
|
task :seed => :environment do
|
|
|
|
require 'app/models/map'
|
|
|
|
|
|
|
|
csv_filename = File.expand_path(
|
|
|
|
'../../db/capital-cities.csv', File.dirname(__FILE__)
|
|
|
|
)
|
|
|
|
Map.import(csv_filename) do |map|
|
|
|
|
puts "Seeded map '#{map.name}'"
|
|
|
|
end
|
2012-03-05 14:42:09 +00:00
|
|
|
end
|
2012-03-08 12:51:59 +00:00
|
|
|
|
|
|
|
desc 'Seed the maps a little bit less!'
|
|
|
|
task :miniseed => :environment do
|
|
|
|
require 'app/models/map'
|
|
|
|
|
|
|
|
csv_filename = File.expand_path(
|
|
|
|
'../../db/top-us-cities.csv', File.dirname(__FILE__)
|
|
|
|
)
|
|
|
|
Map.import(csv_filename) do |map|
|
|
|
|
puts "Seeded map '#{map.name}'"
|
|
|
|
end
|
|
|
|
end
|
2012-03-05 14:42:09 +00:00
|
|
|
end
|