box-o-sand/rails/map-mash/lib/tasks/maps.rake

14 lines
302 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
end