bulk_dependency_eraser 1.0.0 → 1.0.1
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: 97a8415296925a84d544fa6a4deddcd0d5f2162116ed9c7bb210bcc16c2e74e6
|
4
|
+
data.tar.gz: f3dca162d1a357c87a305151f087a007005cff8f70656d0e4e514a0c6b419079
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a8fdc09856d111bbcf8a27057515e637b3e29866d9e5963b1851d0678f71c585331aab6cf63e9d8534cf7ad47e624f71035a5a09ba26dd168b10c0cf030f956
|
7
|
+
data.tar.gz: 8b3ce6e5e3391f639f9007a1990e21011a5173bc092f7e0eab234751130a3b6d5594f238609014b7e4ddff49b937af7c3773b0c79cbda1e4e4d191060e7fa5f2
|
@@ -15,6 +15,12 @@ module BulkDependencyEraser
|
|
15
15
|
ignore_klass_names_and_dependencies: [],
|
16
16
|
}.freeze
|
17
17
|
|
18
|
+
DEFAULT_DB_WRAPPER = ->(block) do
|
19
|
+
ActiveRecord::Base.connected_to(role: :reading) do
|
20
|
+
block.call
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
18
24
|
DEPENDENCY_NULLIFY = %i[
|
19
25
|
nullify
|
20
26
|
].freeze
|
@@ -7,6 +7,12 @@ module BulkDependencyEraser
|
|
7
7
|
enable_invalid_foreign_key_detection: false
|
8
8
|
}.freeze
|
9
9
|
|
10
|
+
DEFAULT_DB_WRAPPER = ->(block) do
|
11
|
+
ActiveRecord::Base.connected_to(role: :writing) do
|
12
|
+
block.call
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
10
16
|
def initialize class_names_and_ids: {}, opts: {}
|
11
17
|
@class_names_and_ids = class_names_and_ids
|
12
18
|
super(opts:)
|
@@ -5,6 +5,12 @@ module BulkDependencyEraser
|
|
5
5
|
db_nullify_wrapper: self::DEFAULT_DB_WRAPPER
|
6
6
|
}.freeze
|
7
7
|
|
8
|
+
DEFAULT_DB_WRAPPER = ->(block) do
|
9
|
+
ActiveRecord::Base.connected_to(role: :writing) do
|
10
|
+
block.call
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
8
14
|
# @param class_names_columns_and_ids [Hash] - model names with columns to nullify pointing towards the record IDs that require the nullification.
|
9
15
|
# - structure:
|
10
16
|
# {
|