activerecord_csv_importer 0.1.0 → 0.1.1

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: 62b46ebbaa1845d396dba93a645a0e380634c0f5
4
- data.tar.gz: 6b3487666658e35b4b195bce03043165b1788675
3
+ metadata.gz: 6d1a505ce5dfd1cb65fed9b65f5cd77e09a8d905
4
+ data.tar.gz: 0c04ae7e26d2cc0b96e615d5561ea11aa23e823a
5
5
  SHA512:
6
- metadata.gz: 044fab5881d472092998ea2ca7c893b86ac1ff1671b8380ed94462793b93b7088e22e90c1a3f7df5b5dbe69d192c8690c5edcf7aa6a3d9d1be2475af42ee1a2d
7
- data.tar.gz: 5be82ce068a1f0651aca75317dbe094d372ad6ee34730cada3cdccd8ddcec95d2fca170a7e54eb4e2066479f961862aefd62f2eae2ffc4417395dd14e38be7b9
6
+ metadata.gz: 3c4a4cca5c6a5135f5535cf9399e89d0c18342240bc22ce5936a2bd0d77fb37b853555ed54d5aaecee9392672c8aefce1101ff20392b2c337a3bbabed6489f59
7
+ data.tar.gz: a72973e303bb5312d272b3331719238e19e543e1559fe9cd2b9864c6915081693b5fe3833e17eece818bfbd9cd2062fcf25e0d97163d0eca61c60b34020ad527
@@ -42,6 +42,10 @@ module ActiveRecordCSVImporter
42
42
  (column_definitions - columns.map(&:definition)).map(&:name).map(&:to_s)
43
43
  end
44
44
 
45
+ def column_definition_names
46
+ column_definitions.map(&:name).map(&:to_s)
47
+ end
48
+
45
49
  private
46
50
 
47
51
  def find_column_definition(name)
@@ -49,9 +53,5 @@ module ActiveRecordCSVImporter
49
53
  column_definition.match?(name)
50
54
  }
51
55
  end
52
-
53
- def column_definition_names
54
- column_definitions.map(&:name).map(&:to_s)
55
- end
56
56
  end
57
57
  end
@@ -38,7 +38,7 @@ module ActiveRecordCSVImporter
38
38
  end
39
39
 
40
40
  def import_rows(set)
41
- config.model.import(header.column_names.dup, set, config.on_duplicate_key)
41
+ config.model.import(header.column_definition_names.dup, set, config.on_duplicate_key)
42
42
  end
43
43
 
44
44
  def add_to_report(response, set)
@@ -50,7 +50,7 @@ module ActiveRecordCSVImporter
50
50
  end
51
51
 
52
52
  def columns_for(model)
53
- model.attributes.values_at(*header.column_names)
53
+ model.attributes.values_at(*header.column_definition_names)
54
54
  end
55
55
 
56
56
  # Error from the model mapped back to the CSV header if we can
@@ -1,3 +1,3 @@
1
1
  module ActiveRecordCSVImporter
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord_csv_importer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zulfiqar Ali