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: a505cd8d1072193bb45a5896b9ec1882793c030552ff4a992f06f48b446deca9
4
- data.tar.gz: 0061d59c8ccd8abe86eedf0bd78e7fb57f6ed2b14e03fd0ad2c247c136c1ffef
3
+ metadata.gz: 3466516854a6d613dae24320c55a3a5de1d921b53f8e9de06f08cde2226ff87d
4
+ data.tar.gz: 34c1025b73e2410eb3dca55ff7197903a1da148ed1bad55833f8495d70900265
5
5
  SHA512:
6
- metadata.gz: e6363cea019a2c86478e3ba5c79c6348db9868c64c40a02a326849827e404bae1542bb3c9686f1ad258717a432c52706b3ce2cbde58e820e520604743c7e7b12
7
- data.tar.gz: 1af86850bdacf28110bfa80236ee188c8a5995e92214ee6e4e099696870385f3d62c504031501039747ac4c03cc43b95af7cb24aaae22825c6630e7740c143e4
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
@@ -1,3 +1,3 @@
1
1
  module BulkDependencyEraser
2
- VERSION = "1.4.3".freeze
2
+ VERSION = "1.5.0".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bulk_dependency_eraser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - benjamin.dana.software.dev@gmail.com