BikeCsvImporter: import bikes, first step (main code, shop_id)

This commit is contained in:
Ilya Konanykhin
2017-03-16 15:17:14 +06:00
parent 904b824c8b
commit 5564a1931f
3 changed files with 115 additions and 69 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ namespace :import do
file = args[:file]
next puts "Usage: rake #{t.name}[$csv_file_path]" unless file
next puts "File #{file} does not exist or is unreachable" unless File.readable? file
pp BikesCsvImporter.new(file).run
pp BikeCsvImporter.new(file).run
end
# Analyze a single field from CSV file
@@ -13,7 +13,7 @@ namespace :import do
file, field = args.values_at :file, :field
next puts "Usage: rake #{t.name}[$csv_file_path[,\"$field_name\"]]" unless file
next puts "File #{file} does not exist or is unreachable" unless File.readable? file
pp BikesCsvImporter.new(file).analyze field ? [field] : []
pp BikeCsvImporter.new(file).analyze field ? [field] : []
end
end
end