config/initializers/importer.rb in kuppayam-0.1.10 vs config/initializers/importer.rb in kuppayam-0.1.11
- old
+ new
@@ -125,11 +125,11 @@
print_memory_usage do
print_time_spent do
sum = 0
CSV.foreach(csv_path, headers: true, header_converters: :symbol) do |row|
- obj, error_object = save_row_data(row)
+ error_object = save_row_data(row)
errors << error_object if error_object
error_object.print_dot if error_object && verbose
sum += 1
end
@@ -151,18 +151,18 @@
# , encoding: 'windows-1251:utf-8', :row_sep => :auto
if single_transaction
ActiveRecord::Base.transaction do
CSV.foreach(csv_path, headers: true, header_converters: :symbol, skip_blanks: true) do |row|
- obj, error_object = save_row_data(row)
+ error_object = save_row_data(row)
errors << error_object if error_object
error_object.print_dot if error_object && verbose
sum += 1
end
end
else
CSV.foreach(csv_path, headers: true, header_converters: :symbol, skip_blanks: true) do |row|
- obj, error_object = save_row_data(row)
+ error_object = save_row_data(row)
errors << error_object if error_object
error_object.print_dot if error_object && verbose
sum += 1
end
end
\ No newline at end of file