ar-ondemand 1.0.2 → 1.0.3
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 +8 -8
- data/lib/ar-ondemand/delete_all_by_pk.rb +3 -3
- data/lib/ar-ondemand/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MGQxNGNjMTg4NzdkYjU2M2RiYTAyM2I3OTdiZDUyMzVjYTI3N2M5OQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Y2FjNGMzMjNjZDRiNjlmNDBjY2IxYWNkNTJjMDI0ODM1ODBhYTFhZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OTRmYjk4ODgxYWEzNzNlZDk1ZGVlNDFmYzY1NGY5ODEyNTFlZTQxOTg1YWRm
|
10
|
+
ZWI0MjkzYjg3NGU3ODc3Mzc3YzViNWM4YzgyZjM1NDMwMTkzNmI1NDYzZGEz
|
11
|
+
ZTE4MmZmYzc0MmU3OTI0NTQ3ZmNhODM4MWM4MWM2ZTc3M2Q5NTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OGRlMTcyOWRiZGU3MjZiMWJiZjFmNTEzZGU1ZTRlZDFlOGQ4ZWQwZjI2MzVl
|
14
|
+
YzlmMThhYzM5ODU4NzkwNTZiNDBmNjkxNDUxNmM2MDE4OWJmOTkwZmI0Mzhk
|
15
|
+
NDA0N2JiYWU0MTNlMGQ1NGM4YmNkMGVhMWE0OGNiMGRjZGU2N2U=
|
@@ -21,9 +21,9 @@ module ActiveRecord
|
|
21
21
|
end
|
22
22
|
|
23
23
|
start = options.delete(:start)
|
24
|
-
batch_size = options.delete(:batch_size)
|
24
|
+
batch_size = options.delete(:batch_size)
|
25
25
|
|
26
|
-
relation = relation.reorder(batch_order).limit(batch_size)
|
26
|
+
relation = relation.reorder(batch_order).limit(batch_size) if batch_size
|
27
27
|
records = start ? query(relation.where(table[primary_key].gteq(start))) : query(relation)
|
28
28
|
|
29
29
|
while records.any?
|
@@ -32,7 +32,7 @@ module ActiveRecord
|
|
32
32
|
|
33
33
|
self.unscoped.where(id: records).delete_all
|
34
34
|
|
35
|
-
break if records_size < batch_size
|
35
|
+
break if batch_size.nil? || records_size < batch_size
|
36
36
|
|
37
37
|
records = query relation.where(table[primary_key].gt(primary_key_offset))
|
38
38
|
end
|
data/lib/ar-ondemand/version.rb
CHANGED