global-registry-bindings 0.7.2 → 0.8.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 +4 -4
- data/lib/global_registry_bindings/entity/push_entity_methods.rb +1 -2
- data/lib/global_registry_bindings/entity/relationship_type_methods.rb +2 -2
- data/lib/global_registry_bindings/model/entity.rb +2 -2
- data/lib/global_registry_bindings/model/push_relationship.rb +1 -1
- data/lib/global_registry_bindings/model/relationship.rb +2 -2
- data/lib/global_registry_bindings/version.rb +1 -1
- data/lib/global_registry_bindings/worker.rb +2 -2
- data/lib/global_registry_bindings/workers/pull_mdm_id_worker.rb +2 -2
- data/lib/global_registry_bindings/workers/push_entity_worker.rb +1 -1
- data/lib/global_registry_bindings/workers/push_relationship_worker.rb +2 -2
- metadata +17 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55800dfbfa2f1fbfba6a039f3c5cf1730c5e9851895434763923e24d3a8bcc0f
|
4
|
+
data.tar.gz: 59f6753938295cf55faaa971e36088d7c5649ffa7e86be7642db7bedf920db4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5278459b66d81d1a35f644cd4dcf57193a791555b0e1ff86e52a787dca7d01d7ed9a82ecf42190063f2e9c43c2d50180bcc1130af92945e90a05638bb8635603
|
7
|
+
data.tar.gz: 465b8e6760171ba632a84a2fabed6bf48b6f1dae8ceadb8c54acf6a40a13648225e02e08b04b905f896f07ad9181c879242d88eb862c83a44c7f243a4e4d2b80
|
@@ -71,8 +71,7 @@ module GlobalRegistry # :nodoc:
|
|
71
71
|
end
|
72
72
|
|
73
73
|
def ensure_parent_entity_has_global_registry_id!
|
74
|
-
return
|
75
|
-
global_registry_entity.parent_id_value.blank?
|
74
|
+
return if global_registry_entity.parent_id_value.present?
|
76
75
|
# Push parent entity if it exists and is missing global_registry_id
|
77
76
|
global_registry_entity.parent.push_entity_to_global_registry_async
|
78
77
|
raise GlobalRegistry::Bindings::ParentEntityMissingGlobalRegistryId,
|
@@ -54,7 +54,7 @@ module GlobalRegistry # :nodoc:
|
|
54
54
|
entity_type&.dig("id")
|
55
55
|
end
|
56
56
|
|
57
|
-
def related_associated_entity_type_id
|
57
|
+
def related_associated_entity_type_id # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
58
58
|
unless global_registry_relationship(type).related
|
59
59
|
related_type = global_registry_relationship(type).related_type
|
60
60
|
# remote foreign_key doesn't have a model class in rails. Short-circuit and fetch entity_type by name
|
@@ -73,7 +73,7 @@ module GlobalRegistry # :nodoc:
|
|
73
73
|
related_worker.send(:push_entity_type_to_global_registry)&.dig("id")
|
74
74
|
end
|
75
75
|
|
76
|
-
def push_global_registry_relationship_type_fields(relationship_type)
|
76
|
+
def push_global_registry_relationship_type_fields(relationship_type) # rubocop:disable Metrics/AbcSize
|
77
77
|
existing_fields = relationship_type["fields"]&.collect { |f| f["name"].to_sym } || []
|
78
78
|
fields = model.relationship_columns_to_push(type)
|
79
79
|
.except(*existing_fields)
|
@@ -13,7 +13,7 @@ module GlobalRegistry # :nodoc:
|
|
13
13
|
entity_attributes[:client_integration_id] = id unless global_registry_entity.exclude
|
14
14
|
.include?(:client_integration_id)
|
15
15
|
if respond_to?(:updated_at) && updated_at.present?
|
16
|
-
entity_attributes[:client_updated_at] = updated_at.
|
16
|
+
entity_attributes[:client_updated_at] = updated_at.to_fs(:db)
|
17
17
|
end
|
18
18
|
if global_registry_entity.parent_is_self?
|
19
19
|
entity_attributes[:parent_id] = global_registry_entity.parent_id_value
|
@@ -26,7 +26,7 @@ module GlobalRegistry # :nodoc:
|
|
26
26
|
return [name, value] if value.nil?
|
27
27
|
value = case type
|
28
28
|
when :datetime, :date
|
29
|
-
value.
|
29
|
+
value.to_fs(:db)
|
30
30
|
when :boolean
|
31
31
|
value ? "true" : "false"
|
32
32
|
else
|
@@ -18,7 +18,7 @@ module GlobalRegistry # :nodoc:
|
|
18
18
|
types = types.empty? ? self.class.global_registry_relationship_types : types
|
19
19
|
types.each do |type|
|
20
20
|
action = global_registry_relationship_change_action(type)
|
21
|
-
send("global_registry_relationship_async_#{action}"
|
21
|
+
send(:"global_registry_relationship_async_#{action}", type)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -13,7 +13,7 @@ module GlobalRegistry # :nodoc:
|
|
13
13
|
unless global_registry_relationship(type).exclude.include?(:client_integration_id)
|
14
14
|
entity_attributes[:client_integration_id] = global_registry_relationship(type).client_integration_id
|
15
15
|
end
|
16
|
-
entity_attributes[:client_updated_at] = updated_at.
|
16
|
+
entity_attributes[:client_updated_at] = updated_at.to_fs(:db) if respond_to?(:updated_at)
|
17
17
|
entity_attributes
|
18
18
|
end
|
19
19
|
|
@@ -22,7 +22,7 @@ module GlobalRegistry # :nodoc:
|
|
22
22
|
return [name, value] if value.nil?
|
23
23
|
value = case type
|
24
24
|
when :datetime, :date
|
25
|
-
value.
|
25
|
+
value.to_fs(:db)
|
26
26
|
when :boolean
|
27
27
|
value ? "true" : "false"
|
28
28
|
else
|
@@ -25,11 +25,11 @@ module GlobalRegistry # :nodoc:
|
|
25
25
|
# Set global sidekiq_options
|
26
26
|
worker = set(GlobalRegistry::Bindings.sidekiq_options)
|
27
27
|
if worker == self # sidekiq 4.x
|
28
|
-
super
|
28
|
+
super
|
29
29
|
else # sidekiq 5.x
|
30
30
|
worker.perform_async(*args)
|
31
31
|
end
|
32
|
-
rescue
|
32
|
+
rescue RedisClient::Error => e
|
33
33
|
case GlobalRegistry::Bindings.redis_error_action
|
34
34
|
when :raise
|
35
35
|
raise
|
@@ -15,7 +15,7 @@ module GlobalRegistry # :nodoc:
|
|
15
15
|
|
16
16
|
const_set worker_class_name, klass
|
17
17
|
|
18
|
-
if Rails.gem_version < Gem::Version.new(
|
18
|
+
if Rails.gem_version < Gem::Version.new("7") # only works with "classic" loader, not zeitwerk
|
19
19
|
ActiveSupport::Dependencies.mark_for_unload(klass)
|
20
20
|
end
|
21
21
|
|
@@ -26,7 +26,7 @@ module GlobalRegistry # :nodoc:
|
|
26
26
|
include GlobalRegistry::Bindings::Entity::MdmMethods
|
27
27
|
|
28
28
|
def perform(model_class, id)
|
29
|
-
super
|
29
|
+
super
|
30
30
|
pull_mdm_id_from_global_registry
|
31
31
|
rescue ActiveRecord::RecordNotFound
|
32
32
|
# If the record was deleted after the job was created, swallow it
|
@@ -13,7 +13,7 @@ module GlobalRegistry # :nodoc:
|
|
13
13
|
sidekiq_options unique: :until_and_while_executing
|
14
14
|
|
15
15
|
def perform(model_class, id)
|
16
|
-
super
|
16
|
+
super
|
17
17
|
push_entity_to_global_registry
|
18
18
|
rescue ActiveRecord::RecordNotFound # rubocop:disable Lint/HandleExceptions
|
19
19
|
# If the record was deleted after the job was created, swallow it
|
@@ -15,12 +15,12 @@ module GlobalRegistry # :nodoc:
|
|
15
15
|
attr_accessor :type
|
16
16
|
|
17
17
|
def initialize(model = nil, type = nil)
|
18
|
-
super
|
18
|
+
super(model)
|
19
19
|
self.type = type.to_sym if type
|
20
20
|
end
|
21
21
|
|
22
22
|
def perform(model_class, id, type)
|
23
|
-
super
|
23
|
+
super(model_class, id)
|
24
24
|
self.type = type.to_sym
|
25
25
|
push_relationship_to_global_registry
|
26
26
|
rescue ActiveRecord::RecordNotFound # rubocop:disable Lint/HandleExceptions
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: global-registry-bindings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Zoetewey
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: activerecord
|
@@ -56,20 +55,20 @@ dependencies:
|
|
56
55
|
requirements:
|
57
56
|
- - ">="
|
58
57
|
- !ruby/object:Gem::Version
|
59
|
-
version: '
|
58
|
+
version: '7'
|
60
59
|
- - "<"
|
61
60
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
61
|
+
version: '9'
|
63
62
|
type: :runtime
|
64
63
|
prerelease: false
|
65
64
|
version_requirements: !ruby/object:Gem::Requirement
|
66
65
|
requirements:
|
67
66
|
- - ">="
|
68
67
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
68
|
+
version: '7'
|
70
69
|
- - "<"
|
71
70
|
- !ruby/object:Gem::Version
|
72
|
-
version: '
|
71
|
+
version: '9'
|
73
72
|
- !ruby/object:Gem::Dependency
|
74
73
|
name: sidekiq-unique-jobs
|
75
74
|
requirement: !ruby/object:Gem::Requirement
|
@@ -79,7 +78,7 @@ dependencies:
|
|
79
78
|
version: 5.0.0
|
80
79
|
- - "<"
|
81
80
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
81
|
+
version: '9'
|
83
82
|
type: :runtime
|
84
83
|
prerelease: false
|
85
84
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -89,7 +88,7 @@ dependencies:
|
|
89
88
|
version: 5.0.0
|
90
89
|
- - "<"
|
91
90
|
- !ruby/object:Gem::Version
|
92
|
-
version: '
|
91
|
+
version: '9'
|
93
92
|
- !ruby/object:Gem::Dependency
|
94
93
|
name: deepsort
|
95
94
|
requirement: !ruby/object:Gem::Requirement
|
@@ -144,14 +143,20 @@ dependencies:
|
|
144
143
|
requirements:
|
145
144
|
- - ">="
|
146
145
|
- !ruby/object:Gem::Version
|
147
|
-
version:
|
146
|
+
version: '7.0'
|
147
|
+
- - "<"
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '7.2'
|
148
150
|
type: :development
|
149
151
|
prerelease: false
|
150
152
|
version_requirements: !ruby/object:Gem::Requirement
|
151
153
|
requirements:
|
152
154
|
- - ">="
|
153
155
|
- !ruby/object:Gem::Version
|
154
|
-
version:
|
156
|
+
version: '7.0'
|
157
|
+
- - "<"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '7.2'
|
155
160
|
- !ruby/object:Gem::Dependency
|
156
161
|
name: bundler
|
157
162
|
requirement: !ruby/object:Gem::Requirement
|
@@ -250,20 +255,6 @@ dependencies:
|
|
250
255
|
- - "~>"
|
251
256
|
- !ruby/object:Gem::Version
|
252
257
|
version: '1.4'
|
253
|
-
- !ruby/object:Gem::Dependency
|
254
|
-
name: mock_redis
|
255
|
-
requirement: !ruby/object:Gem::Requirement
|
256
|
-
requirements:
|
257
|
-
- - "~>"
|
258
|
-
- !ruby/object:Gem::Version
|
259
|
-
version: 0.17.0
|
260
|
-
type: :development
|
261
|
-
prerelease: false
|
262
|
-
version_requirements: !ruby/object:Gem::Requirement
|
263
|
-
requirements:
|
264
|
-
- - "~>"
|
265
|
-
- !ruby/object:Gem::Version
|
266
|
-
version: 0.17.0
|
267
258
|
- !ruby/object:Gem::Dependency
|
268
259
|
name: simplecov
|
269
260
|
requirement: !ruby/object:Gem::Requirement
|
@@ -349,7 +340,6 @@ homepage: https://github.com/CruGlobal/global-registry-bindings
|
|
349
340
|
licenses:
|
350
341
|
- MIT
|
351
342
|
metadata: {}
|
352
|
-
post_install_message:
|
353
343
|
rdoc_options: []
|
354
344
|
require_paths:
|
355
345
|
- lib
|
@@ -364,8 +354,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
364
354
|
- !ruby/object:Gem::Version
|
365
355
|
version: '0'
|
366
356
|
requirements: []
|
367
|
-
rubygems_version: 3.
|
368
|
-
signing_key:
|
357
|
+
rubygems_version: 3.6.8
|
369
358
|
specification_version: 4
|
370
359
|
summary: ActiveRecord bindings for Global Registry
|
371
360
|
test_files: []
|