lib/loaders/csv_loader.rb in datashift-0.6.1 vs lib/loaders/csv_loader.rb in datashift-0.7.0
- old
+ new
@@ -30,14 +30,12 @@
# Create a method_mapper which maps list of headers into suitable calls on the Active Record class
# For example if model has an attribute 'price' will map columns called Price, price, PRICE etc to this attribute
map_headers_to_operators( @parsed_file.shift, options)
- #if(options[:verbose])
puts "\n\n\nLoading from CSV file: #{file_name}"
puts "Processing #{@parsed_file.size} rows"
- # end
load_object_class.transaction do
@loaded_objects = []
@parsed_file.each do |row|
@@ -64,10 +62,10 @@
end
# TODO - handle when it's not valid ?
# Process rest and dump out an exception list of Products ??
- logger.info "Saving csv row #{row} to table object : #{load_object.inspect}" #if options[:verbose]
+ logger.info "Saving csv row #{row} to table object : #{load_object.inspect}"
save
# don't forget to reset the object or we'll update rather than create
new_load_object
\ No newline at end of file