abstract_importer 1.3.2 → 1.3.3

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: 48e21131bf98cff4d6e2c9bd6d26d1250081f23a
4
- data.tar.gz: 1f213fef44ac6fa850a87405118807708071dadc
3
+ metadata.gz: e3c6b8d26de8bab191b1284a03f2bc563f394b17
4
+ data.tar.gz: a9ae38851ed8554c95cf4d8265283f2a5d141832
5
5
  SHA512:
6
- metadata.gz: df926ba45f927f96b45f70acbd156244a32db2bb91052befbaba386ff3f624b019ade75d01eb65698aa305ab7dd675b1888a2528bae7afe8d70e9b37c095ed84
7
- data.tar.gz: e48bf3593a2a36dcde98084ea43c574f41707a2e458e373feed19a8be97383428668c6b70c87e75b608ad8b9d21cfc97342f332d0c8d2b5d16fee61edd626869
6
+ metadata.gz: 8c25ef8ea38b675426863a7299835c05a5a46dd124dd08d39453b66a81f9e3338d2706e3f41c18056926f2e44a32af1c23d5c3d2164de512d1aedc4ea581e35e
7
+ data.tar.gz: e4b471c39b1f775219efab5d9767e2fef4855a0d783526e991b9165e8e0e3ca4659f042268c7e6da3b8c191ef1569fa217b86e0427b4f653c4a143b90ac04091
@@ -47,8 +47,11 @@ module AbstractImporter
47
47
  retry
48
48
  end
49
49
 
50
- id_map.merge! collection.table_name, collection.scope
51
- .where(legacy_id: @batch.map { |hash| hash[:legacy_id] })
50
+ ids = collection.scope.where(legacy_id: @batch.map { |hash| hash[:legacy_id] })
51
+ id_map.merge! collection.table_name, ids
52
+
53
+ summary.created += ids.length
54
+
52
55
  @batch = []
53
56
  end
54
57
 
@@ -1,3 +1,3 @@
1
1
  module AbstractImporter
2
- VERSION = "1.3.2"
2
+ VERSION = "1.3.3"
3
3
  end
@@ -21,6 +21,16 @@ class ImporterTest < ActiveSupport::TestCase
21
21
  import!
22
22
  assert_equal [456, 457, 458], account.students.pluck(:legacy_id)
23
23
  end
24
+
25
+ should "report that it found 3 records" do
26
+ summary = import!
27
+ assert_equal 3, summary[:students].total
28
+ end
29
+
30
+ should "report that it created 3 records" do
31
+ summary = import!
32
+ assert_equal 3, summary[:students].created
33
+ end
24
34
  end
25
35
 
26
36
  context "with a complex data source" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abstract_importer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Lail
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-17 00:00:00.000000000 Z
11
+ date: 2015-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord