activerecord_data_importer 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 569cc45259f9643c410bf2c660293351868b7767
4
- data.tar.gz: 8b48cf3961e82cb42d276c4c150165335dcc0690
3
+ metadata.gz: 8c6e121d04fedadc485969608f9a3059d4bd5a86
4
+ data.tar.gz: 81c0bec1c4c07881ed4309bfe01ca4d84d828da2
5
5
  SHA512:
6
- metadata.gz: e79e853baa867a51b853572e485c09cf87f557b65a4bc8afa1ca0c28db44ee2d6cb21bace280fd36c2f59746624b888e206952b4193df506dabfb1d8945e0ff3
7
- data.tar.gz: 026811940b9e78d57b3a1c6c744a1acd0136a01014e4a33d7440cb74699de4a2bb05f18b3f82c90259f037a8a5e9f2f9b5c68515e78ce2050c145b47090abab4
6
+ metadata.gz: a898b0a8f735cef8a9f970391c4d7225e30f7da6286e62716eb5ea6636196687b6ad5e442053b6dd4e20119f2b973de3eb96315341b357fa85c363bcbddae0cd
7
+ data.tar.gz: a411a87e7cab4a05427b32ed0848e7e7af88224657e0d81417c8f0f34c01c695c33bf20c0c572f47359347ea2ab11852f488c3147edf576a74ac3d6181cfb3c0
@@ -1,7 +1,7 @@
1
1
  require "csv"
2
2
  class ActiverecordDataImporter::CsvConverter
3
3
  def self.convert_csv_to_hash(filename)
4
- csvs = CSV.table(filename, header_converters: lambda { |h| h.underscore })
4
+ csvs = CSV.open(filename, "rb:BOM|UTF-8", headers: true, header_converters: lambda { |h| h.underscore } ).read
5
5
  hash = csvs.map do |csv|
6
6
  self.convert_attributes csv.to_h
7
7
  end
@@ -1,3 +1,3 @@
1
1
  module ActiverecordDataImporter
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord_data_importer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ukayare