box-o-sand/map-mash/lib/tasks/maps.rake
Dan Buch d834b81003 Add 'map-mash/' from commit '7f16409d1257e7471fef35c18bcdf32856b908e3'
git-subtree-dir: map-mash
git-subtree-mainline: eacc351b17
git-subtree-split: 7f16409d12
2013-01-09 23:59:47 -05:00

26 lines
603 B
Ruby

namespace :maps do
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
end
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
end