occams-record 1.1.3 → 1.1.4
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/lib/occams-record/batches.rb +3 -4
- data/lib/occams-record/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4c5eba9d662af4ceea78d6d50d9649dc88faebb18ab8f2d9e0704f4fe5367985
|
|
4
|
+
data.tar.gz: cd5aa76eeb6a5f89ed65bd10549e468173dc2f8aa896346925b4b3752cf7858e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d48d4389624f627302877ca6bcda1e7b1dc19facd4b54b4d255bb11b75d1f79149c1e79aff271b715eca0f43e03819e5aaaebc2897a7b0b29696eb20e0bcc4fc
|
|
7
|
+
data.tar.gz: ab8fdfddb10f751aa74274efc6229e5c24d32ec968fe8c88f30fd9af760652d9a75a2cc2bc17c29e3afcdd41b2d6f78e7cda60d485b6844458267beda2839aa2
|
|
@@ -7,9 +7,8 @@ module OccamsRecord
|
|
|
7
7
|
# Load records in batches of N and yield each record to a block if given. If no block is given,
|
|
8
8
|
# returns an Enumerator.
|
|
9
9
|
#
|
|
10
|
-
# NOTE Unlike ActiveRecord's find_each, ORDER BY is respected.
|
|
11
|
-
#
|
|
12
|
-
# of a transaction.
|
|
10
|
+
# NOTE Unlike ActiveRecord's find_each, ORDER BY is respected. It will be run inside
|
|
11
|
+
# of a transaction to ensure batch integrity.
|
|
13
12
|
#
|
|
14
13
|
# @param batch_size [Integer]
|
|
15
14
|
# @param use_transaction [Boolean] Ensure it runs inside of a database transaction
|
|
@@ -84,7 +83,7 @@ module OccamsRecord
|
|
|
84
83
|
|
|
85
84
|
until out_of_records
|
|
86
85
|
l = limit && batch_size > limit - count ? limit - count : batch_size
|
|
87
|
-
q = scope.
|
|
86
|
+
q = scope.offset(offset).limit(l)
|
|
88
87
|
results = Query.new(q, use: @use, query_logger: @query_logger, eager_loaders: @eager_loaders).run
|
|
89
88
|
|
|
90
89
|
y.yield results if results.any?
|