composite_primary_keys 12.0.5 → 12.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/History.rdoc +3 -0
- data/lib/composite_primary_keys/relation/batches.rb +1 -1
- data/lib/composite_primary_keys/version.rb +1 -1
- data/test/test_find.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea522edb09ab0dfd60a25bb34aa7c31a50f1afc2260b54189338a694dce48c5b
|
4
|
+
data.tar.gz: 5aefc2529dbfe80f7453ad75e2d3043fb329dc8294ac80f56ef2ce60988d8d45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f482042e909cbd80341bb609387d41fe82236d82c9f26aa5742e0c4ce470eb873ced0b48a461ec3836b361e0075c9c831f75e2f69023787738e6cca0e5a34026
|
7
|
+
data.tar.gz: 649981635ecf30e0a94dfd811230395af0c0ab1111beec027fc9787d5185e57572f2b0677f8e4e88f01cf2cc784d1d0a2ccbd04ae30898ee2e860a9950a5e355
|
data/History.rdoc
CHANGED
@@ -4,7 +4,7 @@ module CompositePrimaryKeys
|
|
4
4
|
def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil)
|
5
5
|
relation = self
|
6
6
|
unless block_given?
|
7
|
-
return BatchEnumerator.new(of: of, start: start, finish: finish, relation: self)
|
7
|
+
return ::ActiveRecord::Batches::BatchEnumerator.new(of: of, start: start, finish: finish, relation: self)
|
8
8
|
end
|
9
9
|
|
10
10
|
if arel.orders.present?
|
data/test/test_find.rb
CHANGED
@@ -103,6 +103,13 @@ class TestFind < ActiveSupport::TestCase
|
|
103
103
|
end
|
104
104
|
end
|
105
105
|
|
106
|
+
def test_in_batches_enumerator
|
107
|
+
enumerator = Department.in_batches
|
108
|
+
enumerator.each do |batch|
|
109
|
+
assert_equal(Department.count, batch.size)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
106
113
|
def test_in_batches_of_1
|
107
114
|
num_found = 0
|
108
115
|
Department.in_batches(of: 1) do |batch|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: composite_primary_keys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 12.0.
|
4
|
+
version: 12.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charlie Savage
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|