rails_admin_import 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -63,9 +63,9 @@ module RailsAdminImport
63
63
  FileUtils.copy(params[:file].tempfile, "#{Rails.root}/log/import/#{Time.now.strftime("%Y-%m-%d-%H-%M-%S")}-import.csv")
64
64
  logger = Logger.new("#{Rails.root}/log/import/import.log")
65
65
  end
66
-
66
+
67
67
  text = File.read(params[:file].tempfile)
68
- clean = text.gsub(/\n$/, '')
68
+ clean = text.force_encoding('BINARY').encode('UTF-8', :undef => :replace, :replace => '').gsub(/\n$/, '')
69
69
  file_check = CSV.new(clean)
70
70
 
71
71
  if file_check.readlines.size > RailsAdminImport.config.line_item_limit
@@ -73,7 +73,7 @@ module RailsAdminImport
73
73
  end
74
74
 
75
75
  map = {}
76
-
76
+
77
77
  file = CSV.new(clean)
78
78
  file.readline.each_with_index do |key, i|
79
79
  if self.many_fields.include?(key.to_sym)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_admin_import
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-28 00:00:00.000000000 Z
12
+ date: 2012-11-08 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: steph@endpoint.com