rails_admin_import 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rails_admin_import/import.rb +3 -1
- metadata +1 -1
@@ -58,7 +58,9 @@ module RailsAdminImport
|
|
58
58
|
return results = { :success => [], :error => ["You must select a file."] }
|
59
59
|
end
|
60
60
|
|
61
|
-
|
61
|
+
text = File.read(params[:file].tempfile)
|
62
|
+
clean = text.gsub(/\n$/, '')
|
63
|
+
file = CSV.new(clean)
|
62
64
|
|
63
65
|
if RailsAdminImport.config.logging
|
64
66
|
FileUtils.copy(params[:file].tempfile, "#{Rails.root}/log/import/#{Time.now.strftime("%Y-%m-%d-%H-%M-%S")}-import.csv")
|