bulk_dependency_eraser 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3cafe34b586a54a169d2d728ba0a39d9403c90796db9f40c9050620eaa4ef156
4
- data.tar.gz: a1a7001243a75db7740e2fbcbdfbf43dad5253f83de8c757bb7b2d0ab2f57763
3
+ metadata.gz: 84aa6beacc6783239cb7203cb6c829b041af7829d0692182475d04e00baed0c0
4
+ data.tar.gz: c6dc0bb1ebc2807aad0f16db6ad4f585a58b31f64ad04b178851dead99459e8e
5
5
  SHA512:
6
- metadata.gz: 9fc46dd24138b1be6c2ff436e9afdaa4f4f877c37fe23bec00ffec8ce142ffda71c6cccefd7a5d8354986757f9df02f0c64918419d270471eea866226cce87a6
7
- data.tar.gz: ecfa3aca0fdae9d2de444f8fb8427758420c8ffa7ae8370daff95b5ef975db83ec9fc573e91d83e93f84acfd11e117171a1a276b45841954526cba6c481d2b21
6
+ metadata.gz: a557bafd9cc91f7611491607e05f5f4dbccb1d059581f2716a51da9b660656d13a490c958990faea6aa655e41fa3d0ad1ed66a70b5ff19bb6c5763f45bdae376
7
+ data.tar.gz: 6d170e68022d2b6fe59b96880f43dafdd52cc837734905de5ca0a65ed2b19d7f01bcce934453dafb0c73a236f0c41a53945f190e386d78f4d1077dc4b6aa6bd4
@@ -2,6 +2,7 @@ module BulkDependencyEraser
2
2
  class Base
3
3
  DEFAULT_OPTS = {}.freeze
4
4
 
5
+ # Default Database wrapper, no effect.
5
6
  DEFAULT_DB_WRAPPER = ->(block) { block.call }
6
7
 
7
8
  attr_reader :errors
@@ -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
  # {
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.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - benjamin.dana.software.dev@gmail.com
@@ -123,7 +123,8 @@ files:
123
123
  homepage: https://github.com/danabr75/bulk_dependency_eraser
124
124
  licenses:
125
125
  - LGPL-3.0-only
126
- metadata: {}
126
+ metadata:
127
+ source_code_uri: https://github.com/danabr75/bulk_dependency_eraser
127
128
  post_install_message:
128
129
  rdoc_options: []
129
130
  require_paths: