bulk_dependency_eraser 1.4.3 → 1.5.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3466516854a6d613dae24320c55a3a5de1d921b53f8e9de06f08cde2226ff87d
|
4
|
+
data.tar.gz: 34c1025b73e2410eb3dca55ff7197903a1da148ed1bad55833f8495d70900265
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67caff3857272988508f54f08aad5b8eddefb4fbd545a652e1d1cb060690b49c01270758237f6a37be4cac52a7c2f8ca43d3d543ab25d5287e0868cca9819443
|
7
|
+
data.tar.gz: 366cc6941a419a0a5437422f7c22f64c712a1cf4a222638de58c22b672f5d60086aadffda673f7edc60565e34eda7bf613345d4d87593097ed24a0aef60aa592
|
@@ -96,13 +96,21 @@ module BulkDependencyEraser
|
|
96
96
|
if batching_disabled?
|
97
97
|
puts "Deleting without batching" if opts_c.verbose
|
98
98
|
delete_in_db do
|
99
|
-
query.where(id: ids).delete_all
|
99
|
+
deletion_result = query.where(id: ids).delete_all
|
100
|
+
# Returning the following data in the event that the gem-implementer wants to insert their own db_delete_wrapper proc
|
101
|
+
# and have access to these objects in their proc.
|
102
|
+
# - query can give them access to the klass and table_name
|
103
|
+
[deletion_result, query, ids]
|
100
104
|
end
|
101
105
|
else
|
102
106
|
puts "Deleting with batching" if opts_c.verbose
|
103
107
|
ids.each_slice(batch_size) do |ids_subset|
|
104
108
|
delete_in_db do
|
105
|
-
query.where(id: ids_subset).delete_all
|
109
|
+
deletion_result = query.where(id: ids_subset).delete_all
|
110
|
+
# Returning the following data in the event that the gem-implementer wants to insert their own db_delete_wrapper proc
|
111
|
+
# and have access to these objects in their proc.
|
112
|
+
# - query can give them access to the klass and table_name
|
113
|
+
[deletion_result, query, ids_subset]
|
106
114
|
end
|
107
115
|
end
|
108
116
|
end
|
@@ -162,12 +162,20 @@ module BulkDependencyEraser
|
|
162
162
|
|
163
163
|
if batching_disabled?
|
164
164
|
nullify_in_db do
|
165
|
-
query.where(id: ids).update_all(nullify_columns)
|
165
|
+
nullification_result = query.where(id: ids).update_all(nullify_columns)
|
166
|
+
# Returning the following data in the event that the gem-implementer wants to insert their own db_nullify_wrapper proc
|
167
|
+
# and have access to these objects in their proc.
|
168
|
+
# - query can give them access to the klass and table_name
|
169
|
+
[nullification_result, query, ids, nullify_columns]
|
166
170
|
end
|
167
171
|
else
|
168
172
|
ids.each_slice(batch_size) do |ids_subset|
|
169
173
|
nullify_in_db do
|
170
|
-
query.where(id: ids_subset).update_all(nullify_columns)
|
174
|
+
nullification_result = query.where(id: ids_subset).update_all(nullify_columns)
|
175
|
+
# Returning the following data in the event that the gem-implementer wants to insert their own db_nullify_wrapper proc
|
176
|
+
# and have access to these objects in their proc.
|
177
|
+
# - query can give them access to the klass and table_name
|
178
|
+
[nullification_result, query, ids_subset, nullify_columns]
|
171
179
|
end
|
172
180
|
end
|
173
181
|
end
|