global-registry-bindings 0.6.2 → 0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/lib/global_registry_bindings/entity/entity_type_methods.rb +16 -18
  3. data/lib/global_registry_bindings/entity/mdm_methods.rb +11 -12
  4. data/lib/global_registry_bindings/entity/push_entity_methods.rb +23 -23
  5. data/lib/global_registry_bindings/entity/push_relationship_methods.rb +18 -18
  6. data/lib/global_registry_bindings/entity/relationship_type_methods.rb +26 -26
  7. data/lib/global_registry_bindings/exceptions.rb +7 -2
  8. data/lib/global_registry_bindings/global_registry_bindings.rb +19 -19
  9. data/lib/global_registry_bindings/model/delete_entity.rb +4 -4
  10. data/lib/global_registry_bindings/model/entity.rb +25 -25
  11. data/lib/global_registry_bindings/model/pull_mdm.rb +5 -5
  12. data/lib/global_registry_bindings/model/push_entity.rb +4 -4
  13. data/lib/global_registry_bindings/model/push_relationship.rb +10 -8
  14. data/lib/global_registry_bindings/model/relationship.rb +18 -18
  15. data/lib/global_registry_bindings/options/entity_class_options.rb +15 -15
  16. data/lib/global_registry_bindings/options/entity_instance_options.rb +11 -11
  17. data/lib/global_registry_bindings/options/entity_options_parser.rb +3 -3
  18. data/lib/global_registry_bindings/options/relationship_class_options.rb +22 -22
  19. data/lib/global_registry_bindings/options/relationship_instance_options.rb +12 -12
  20. data/lib/global_registry_bindings/options/relationship_options_parser.rb +7 -7
  21. data/lib/global_registry_bindings/options.rb +6 -6
  22. data/lib/global_registry_bindings/railtie.rb +7 -7
  23. data/lib/global_registry_bindings/testing.rb +3 -3
  24. data/lib/global_registry_bindings/version.rb +3 -3
  25. data/lib/global_registry_bindings/worker.rb +5 -5
  26. data/lib/global_registry_bindings/workers/delete_entity_worker.rb +3 -3
  27. data/lib/global_registry_bindings/workers/pull_mdm_id_worker.rb +5 -5
  28. data/lib/global_registry_bindings/workers/push_entity_worker.rb +6 -6
  29. data/lib/global_registry_bindings/workers/push_relationship_worker.rb +6 -6
  30. data/lib/global_registry_bindings.rb +3 -3
  31. metadata +15 -155
  32. data/spec/acceptance/global_registry_bindings_spec.rb +0 -191
  33. data/spec/factories/factories.rb +0 -72
  34. data/spec/fixtures/get_entities_person.json +0 -8
  35. data/spec/fixtures/get_entities_person_mdm.json +0 -13
  36. data/spec/fixtures/get_entities_person_relationship.json +0 -32
  37. data/spec/fixtures/get_entity_types.json +0 -9
  38. data/spec/fixtures/get_entity_types_address.json +0 -59
  39. data/spec/fixtures/get_entity_types_address_partial.json +0 -43
  40. data/spec/fixtures/get_entity_types_area.json +0 -44
  41. data/spec/fixtures/get_entity_types_community.json +0 -18
  42. data/spec/fixtures/get_entity_types_fancy_org.json +0 -43
  43. data/spec/fixtures/get_entity_types_fancy_org_assignment.json +0 -35
  44. data/spec/fixtures/get_entity_types_fancy_org_partial.json +0 -35
  45. data/spec/fixtures/get_entity_types_ministry.json +0 -18
  46. data/spec/fixtures/get_entity_types_person.json +0 -42
  47. data/spec/fixtures/get_entity_types_person_partial.json +0 -34
  48. data/spec/fixtures/get_relationship_types.json +0 -9
  49. data/spec/fixtures/get_relationship_types_person_fancy_org.json +0 -41
  50. data/spec/fixtures/get_relationship_types_person_fancy_org_partial.json +0 -33
  51. data/spec/fixtures/post_entities_community.json +0 -8
  52. data/spec/fixtures/post_entities_fancy_org.json +0 -8
  53. data/spec/fixtures/post_entities_fancy_org_parent.json +0 -8
  54. data/spec/fixtures/post_entities_person.json +0 -8
  55. data/spec/fixtures/post_entity_types_address.json +0 -9
  56. data/spec/fixtures/post_entity_types_fancy_org.json +0 -9
  57. data/spec/fixtures/post_entity_types_person.json +0 -9
  58. data/spec/fixtures/post_relationship_types_assigned_by.json +0 -16
  59. data/spec/fixtures/post_relationship_types_community_ministry.json +0 -16
  60. data/spec/fixtures/post_relationship_types_fancy_org_area.json +0 -16
  61. data/spec/fixtures/post_relationship_types_person_fancy_org.json +0 -16
  62. data/spec/fixtures/put_entities_address.json +0 -20
  63. data/spec/fixtures/put_entities_community_relationship.json +0 -16
  64. data/spec/fixtures/put_entities_fancy_org_area_relationship.json +0 -8
  65. data/spec/fixtures/put_entities_fancy_org_assignment_assigned_by.json +0 -20
  66. data/spec/fixtures/put_entities_fancy_org_relationship.json +0 -17
  67. data/spec/fixtures/put_entities_person_country_relationship.json +0 -23
  68. data/spec/fixtures/put_entities_person_relationship.json +0 -29
  69. data/spec/fixtures/put_entities_relationship.json +0 -8
  70. data/spec/fixtures/put_entities_relationship_400.json +0 -3
  71. data/spec/fixtures/put_relationship_types_fields.json +0 -33
  72. data/spec/fixtures/put_relationship_types_fields_fancy_org_area.json +0 -25
  73. data/spec/helpers/sidekiq_helpers.rb +0 -14
  74. data/spec/internal/app/models/address.rb +0 -17
  75. data/spec/internal/app/models/application_record.rb +0 -5
  76. data/spec/internal/app/models/area.rb +0 -7
  77. data/spec/internal/app/models/assignment.rb +0 -21
  78. data/spec/internal/app/models/community.rb +0 -20
  79. data/spec/internal/app/models/country.rb +0 -8
  80. data/spec/internal/app/models/default.rb +0 -6
  81. data/spec/internal/app/models/namespaced/person/user_edited.rb +0 -8
  82. data/spec/internal/app/models/namespaced/person.rb +0 -68
  83. data/spec/internal/app/models/organization.rb +0 -37
  84. data/spec/internal/config/database.yml +0 -4
  85. data/spec/internal/config/initializers/global_registry.rb +0 -8
  86. data/spec/internal/config/routes.rb +0 -5
  87. data/spec/internal/db/schema.rb +0 -75
  88. data/spec/internal/db/test.sqlite +0 -0
  89. data/spec/internal/log/test.log +0 -1457
  90. data/spec/models/address_spec.rb +0 -30
  91. data/spec/models/assignment_spec.rb +0 -54
  92. data/spec/models/organization_spec.rb +0 -125
  93. data/spec/models/person_spec.rb +0 -191
  94. data/spec/models/testing_spec.rb +0 -55
  95. data/spec/models/user_edited_person_spec.rb +0 -14
  96. data/spec/options/if_unless_spec.rb +0 -147
  97. data/spec/spec_helper.rb +0 -52
  98. data/spec/workers/delete_gr_entity_worker_spec.rb +0 -33
  99. data/spec/workers/pull_mdm_id_worker_spec.rb +0 -133
  100. data/spec/workers/push_entity_worker_spec.rb +0 -506
  101. data/spec/workers/push_relationship_worker_spec.rb +0 -503
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'global_registry_bindings/workers/push_relationship_worker'
4
- require 'global_registry_bindings/workers/delete_entity_worker'
3
+ require "global_registry_bindings/workers/push_relationship_worker"
4
+ require "global_registry_bindings/workers/delete_entity_worker"
5
5
 
6
- module GlobalRegistry #:nodoc:
7
- module Bindings #:nodoc:
8
- module Model #:nodoc:
6
+ module GlobalRegistry # :nodoc:
7
+ module Bindings # :nodoc:
8
+ module Model # :nodoc:
9
9
  module PushRelationship
10
10
  extend ActiveSupport::Concern
11
11
 
@@ -64,19 +64,21 @@ module GlobalRegistry #:nodoc:
64
64
  )
65
65
  end
66
66
 
67
- def global_registry_relationship_async_ignore(_type); end # noop
67
+ # noop
68
+ def global_registry_relationship_async_ignore(_type)
69
+ end
68
70
 
69
71
  # rubocop:disable Metrics/PerceivedComplexity
70
72
  # rubocop:disable Metrics/AbcSize
71
73
  def global_registry_relationship_change_action(type)
72
74
  [global_registry_relationship(type).primary_foreign_key,
73
- global_registry_relationship(type).related_foreign_key].each do |key|
75
+ global_registry_relationship(type).related_foreign_key].each do |key|
74
76
  if previous_changes.key?(key)
75
77
  # Delete if changed from anything to nil
76
78
  return :delete if previous_changes[key].last.nil?
77
79
  # Replace if value changed
78
80
  return :replace if previous_changes[key].first != previous_changes[key].last &&
79
- !previous_changes[key].first.nil?
81
+ !previous_changes[key].first.nil?
80
82
  elsif key.present? && send(key).nil?
81
83
  # Ignore if value didn't change and foreign_key is nil
82
84
  return :ignore
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module GlobalRegistry #:nodoc:
4
- module Bindings #:nodoc:
5
- module Model #:nodoc:
3
+ module GlobalRegistry # :nodoc:
4
+ module Bindings # :nodoc:
5
+ module Model # :nodoc:
6
6
  module Relationship
7
7
  extend ActiveSupport::Concern
8
8
 
@@ -21,13 +21,13 @@ module GlobalRegistry #:nodoc:
21
21
  value = send(name)
22
22
  return [name, value] if value.nil?
23
23
  value = case type
24
- when :datetime, :date
25
- value.to_s(:db)
26
- when :boolean
27
- value ? 'true' : 'false'
28
- else
29
- value.to_s.strip
30
- end
24
+ when :datetime, :date
25
+ value.to_s(:db)
26
+ when :boolean
27
+ value ? "true" : "false"
28
+ else
29
+ value.to_s.strip
30
+ end
31
31
  [name, value]
32
32
  rescue ::NoMethodError
33
33
  nil
@@ -41,9 +41,9 @@ module GlobalRegistry #:nodoc:
41
41
  protected
42
42
 
43
43
  def normalize_relationship_column_type(type, name)
44
- if type.to_s == 'text'
44
+ if type.to_s == "text"
45
45
  :string
46
- elsif name.ends_with?('_id')
46
+ elsif name.ends_with?("_id")
47
47
  :uuid
48
48
  else
49
49
  type
@@ -53,13 +53,13 @@ module GlobalRegistry #:nodoc:
53
53
  def relationship_entity_columns(type)
54
54
  if global_registry_relationship(type).include_all_columns?
55
55
  self.class
56
- .columns
57
- .collect do |c|
58
- { c.name.underscore.to_sym => normalize_relationship_column_type(c.type, c.name) }
56
+ .columns
57
+ .collect do |c|
58
+ {c.name.underscore.to_sym => normalize_relationship_column_type(c.type, c.name)}
59
59
  end # rubocop:disable Style/MultilineBlockChain
60
- .reduce(&:merge)
61
- .reject { |k, _v| global_registry_relationship(type).exclude.include? k }
62
- .merge(global_registry_relationship(type).fields)
60
+ .reduce(&:merge)
61
+ .except(*global_registry_relationship(type).exclude)
62
+ .merge(global_registry_relationship(type).fields)
63
63
  else
64
64
  global_registry_relationship(type).fields || {}
65
65
  end
@@ -1,23 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ostruct'
3
+ require "ostruct"
4
4
 
5
- module GlobalRegistry #:nodoc:
6
- module Bindings #:nodoc:
5
+ module GlobalRegistry # :nodoc:
6
+ module Bindings # :nodoc:
7
7
  module Options
8
8
  class EntityClassOptions
9
9
  delegate :id_column,
10
- :mdm_id_column,
11
- :fingerprint_column,
12
- :type,
13
- :mdm_timeout,
14
- :push_on,
15
- :parent,
16
- :parent_class,
17
- :exclude,
18
- :fields,
19
- :if,
20
- :unless, to: :@options
10
+ :mdm_id_column,
11
+ :fingerprint_column,
12
+ :type,
13
+ :mdm_timeout,
14
+ :push_on,
15
+ :parent,
16
+ :parent_class,
17
+ :exclude,
18
+ :fields,
19
+ :if,
20
+ :unless, to: :@options
21
21
 
22
22
  def initialize(model_class)
23
23
  @model_class = model_class
@@ -33,7 +33,7 @@ module GlobalRegistry #:nodoc:
33
33
  end
34
34
 
35
35
  def mdm_worker_class_name
36
- "Pull#{@model_class.name.tr(':', '')}MdmIdWorker"
36
+ "Pull#{@model_class.name.tr(":", "")}MdmIdWorker"
37
37
  end
38
38
  end
39
39
  end
@@ -1,18 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module GlobalRegistry #:nodoc:
4
- module Bindings #:nodoc:
3
+ module GlobalRegistry # :nodoc:
4
+ module Bindings # :nodoc:
5
5
  module Options
6
6
  class EntityInstanceOptions
7
7
  delegate :id_column,
8
- :mdm_id_column,
9
- :fingerprint_column,
10
- :mdm_timeout,
11
- :push_on,
12
- :mdm_worker_class_name,
13
- :ensure_type?,
14
- :include_all_columns?,
15
- to: :@class_options
8
+ :mdm_id_column,
9
+ :fingerprint_column,
10
+ :mdm_timeout,
11
+ :push_on,
12
+ :mdm_worker_class_name,
13
+ :ensure_type?,
14
+ :include_all_columns?,
15
+ to: :@class_options
16
16
 
17
17
  def initialize(model)
18
18
  @model = model
@@ -93,7 +93,7 @@ module GlobalRegistry #:nodoc:
93
93
  when Symbol
94
94
  @model.send(option, @model)
95
95
  else
96
- :if != cond
96
+ cond != :if
97
97
  end
98
98
  end
99
99
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module GlobalRegistry #:nodoc:
4
- module Bindings #:nodoc:
3
+ module GlobalRegistry # :nodoc:
4
+ module Bindings # :nodoc:
5
5
  module Options
6
6
  class EntityOptionsParser
7
7
  def initialize(model_class)
@@ -39,7 +39,7 @@ module GlobalRegistry #:nodoc:
39
39
 
40
40
  def validate_options!(options = {})
41
41
  unknown = options.keys - defaults.keys
42
- raise ArgumentError, "global-registry-bindings: Unknown options (#{unknown.join ', '})" unless unknown.empty?
42
+ raise ArgumentError, "global-registry-bindings: Unknown options (#{unknown.join ", "})" unless unknown.empty?
43
43
  end
44
44
 
45
45
  def merge_defaults(options_hash = {})
@@ -1,31 +1,31 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ostruct'
3
+ require "ostruct"
4
4
 
5
- module GlobalRegistry #:nodoc:
6
- module Bindings #:nodoc:
5
+ module GlobalRegistry # :nodoc:
6
+ module Bindings # :nodoc:
7
7
  module Options
8
8
  class RelationshipClassOptions
9
9
  delegate :id_column,
10
- :type,
11
- :push_on,
12
- :client_integration_id,
13
- :primary_binding,
14
- :primary,
15
- :primary_class,
16
- :primary_foreign_key,
17
- :primary_name,
18
- :related_binding,
19
- :related,
20
- :related_class,
21
- :related_foreign_key,
22
- :related_type,
23
- :related_name,
24
- :related_global_registry_id,
25
- :exclude,
26
- :fields,
27
- :if,
28
- :unless, to: :@options
10
+ :type,
11
+ :push_on,
12
+ :client_integration_id,
13
+ :primary_binding,
14
+ :primary,
15
+ :primary_class,
16
+ :primary_foreign_key,
17
+ :primary_name,
18
+ :related_binding,
19
+ :related,
20
+ :related_class,
21
+ :related_foreign_key,
22
+ :related_type,
23
+ :related_name,
24
+ :related_global_registry_id,
25
+ :exclude,
26
+ :fields,
27
+ :if,
28
+ :unless, to: :@options
29
29
 
30
30
  def initialize(type, model_class)
31
31
  @model_class = model_class
@@ -1,19 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module GlobalRegistry #:nodoc:
4
- module Bindings #:nodoc:
3
+ module GlobalRegistry # :nodoc:
4
+ module Bindings # :nodoc:
5
5
  module Options
6
6
  class RelationshipInstanceOptions
7
7
  delegate :id_column,
8
- :push_on,
9
- :primary_binding,
10
- :primary_foreign_key,
11
- :related_binding,
12
- :related_foreign_key,
13
- :ensure_type?,
14
- :rename_entity_type?,
15
- :include_all_columns?,
16
- to: :@class_options
8
+ :push_on,
9
+ :primary_binding,
10
+ :primary_foreign_key,
11
+ :related_binding,
12
+ :related_foreign_key,
13
+ :ensure_type?,
14
+ :rename_entity_type?,
15
+ :include_all_columns?,
16
+ to: :@class_options
17
17
 
18
18
  def initialize(type, model)
19
19
  @model = model
@@ -132,7 +132,7 @@ module GlobalRegistry #:nodoc:
132
132
  when Symbol
133
133
  @model.send(option, type, @model)
134
134
  else
135
- :if != cond
135
+ cond != :if
136
136
  end
137
137
  end
138
138
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module GlobalRegistry #:nodoc:
4
- module Bindings #:nodoc:
3
+ module GlobalRegistry # :nodoc:
4
+ module Bindings # :nodoc:
5
5
  module Options
6
6
  class RelationshipOptionsParser
7
7
  def initialize(model_class)
@@ -34,7 +34,7 @@ module GlobalRegistry #:nodoc:
34
34
 
35
35
  def validate_options!(options = {})
36
36
  unknown = options.keys - defaults.keys
37
- raise ArgumentError, "global-registry-bindings: Unknown options (#{unknown.join ', '})" unless unknown.empty?
37
+ raise ArgumentError, "global-registry-bindings: Unknown options (#{unknown.join ", "})" unless unknown.empty?
38
38
  end
39
39
 
40
40
  def merge_defaults(options_hash = {})
@@ -55,10 +55,10 @@ module GlobalRegistry #:nodoc:
55
55
  def update_association_classes
56
56
  unless @options[:primary_class]
57
57
  @options[:primary_class] = if @options[:primary]
58
- association_class @options[:primary]
59
- else
60
- @model_class
61
- end
58
+ association_class @options[:primary]
59
+ else
60
+ @model_class
61
+ end
62
62
  end
63
63
  unless @options[:related_class] # rubocop:disable Style/GuardClause
64
64
  @options[:related_class] = association_class @options[:related]
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'global_registry_bindings/options/entity_instance_options'
4
- require 'global_registry_bindings/options/entity_class_options'
5
- require 'global_registry_bindings/options/relationship_instance_options'
6
- require 'global_registry_bindings/options/relationship_class_options'
3
+ require "global_registry_bindings/options/entity_instance_options"
4
+ require "global_registry_bindings/options/entity_class_options"
5
+ require "global_registry_bindings/options/relationship_instance_options"
6
+ require "global_registry_bindings/options/relationship_class_options"
7
7
 
8
- module GlobalRegistry #:nodoc:
9
- module Bindings #:nodoc:
8
+ module GlobalRegistry # :nodoc:
9
+ module Bindings # :nodoc:
10
10
  module Options
11
11
  extend ActiveSupport::Concern
12
12
 
@@ -1,18 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module GlobalRegistry #:nodoc:
4
- module Bindings #:nodoc:
3
+ module GlobalRegistry # :nodoc:
4
+ module Bindings # :nodoc:
5
5
  class Railtie < Rails::Railtie
6
6
  config.after_initialize do
7
7
  # :nocov:
8
8
  if Module.const_defined? :Rollbar
9
9
  ::Rollbar.configure do |config|
10
10
  config.exception_level_filters.merge!(
11
- 'GlobalRegistry::Bindings::RecordMissingGlobalRegistryId' => 'ignore',
12
- 'GlobalRegistry::Bindings::EntityMissingMdmId' => 'ignore',
13
- 'GlobalRegistry::Bindings::RelatedEntityMissingGlobalRegistryId' => 'ignore',
14
- 'GlobalRegistry::Bindings::ParentEntityMissingGlobalRegistryId' => 'ignore',
15
- 'GlobalRegistry::Bindings::RelatedEntityExistsWithCID' => 'ignore'
11
+ "GlobalRegistry::Bindings::RecordMissingGlobalRegistryId" => "ignore",
12
+ "GlobalRegistry::Bindings::EntityMissingMdmId" => "ignore",
13
+ "GlobalRegistry::Bindings::RelatedEntityMissingGlobalRegistryId" => "ignore",
14
+ "GlobalRegistry::Bindings::ParentEntityMissingGlobalRegistryId" => "ignore",
15
+ "GlobalRegistry::Bindings::RelatedEntityExistsWithCID" => "ignore"
16
16
  )
17
17
  end
18
18
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module GlobalRegistry #:nodoc:
4
- module Bindings #:nodoc:
3
+ module GlobalRegistry # :nodoc:
4
+ module Bindings # :nodoc:
5
5
  class Testing
6
6
  class << self
7
7
  attr_accessor :__test_mode
@@ -44,7 +44,7 @@ module GlobalRegistry #:nodoc:
44
44
 
45
45
  class Worker
46
46
  class << self
47
- alias perform_async_real perform_async
47
+ alias_method :perform_async_real, :perform_async
48
48
 
49
49
  def perform_async(*args)
50
50
  return if GlobalRegistry::Bindings::Testing.skip?
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module GlobalRegistry #:nodoc:
4
- module Bindings #:nodoc:
5
- VERSION = '0.6.2'
3
+ module GlobalRegistry # :nodoc:
4
+ module Bindings # :nodoc:
5
+ VERSION = "0.7"
6
6
  end
7
7
  end
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'sidekiq'
4
- require 'sidekiq-unique-jobs'
3
+ require "sidekiq"
4
+ require "sidekiq-unique-jobs"
5
5
 
6
- module GlobalRegistry #:nodoc:
7
- module Bindings #:nodoc:
6
+ module GlobalRegistry # :nodoc:
7
+ module Bindings # :nodoc:
8
8
  class Worker
9
9
  include Sidekiq::Worker
10
10
 
@@ -36,7 +36,7 @@ module GlobalRegistry #:nodoc:
36
36
  when :log
37
37
  ::Rollbar.error(e) if Module.const_defined? :Rollbar
38
38
  when :ignore
39
- return
39
+ nil
40
40
  end
41
41
  end
42
42
  end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module GlobalRegistry #:nodoc:
4
- module Bindings #:nodoc:
5
- module Workers #:nodoc:
3
+ module GlobalRegistry # :nodoc:
4
+ module Bindings # :nodoc:
5
+ module Workers # :nodoc:
6
6
  class DeleteEntityWorker < ::GlobalRegistry::Bindings::Worker
7
7
  sidekiq_options unique: :until_executed
8
8
 
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'global_registry_bindings/entity/mdm_methods'
3
+ require "global_registry_bindings/entity/mdm_methods"
4
4
 
5
- module GlobalRegistry #:nodoc:
6
- module Bindings #:nodoc:
7
- module Workers #:nodoc:
5
+ module GlobalRegistry # :nodoc:
6
+ module Bindings # :nodoc:
7
+ module Workers # :nodoc:
8
8
  def self.mdm_worker_class(model_class)
9
9
  worker_class_name = model_class.global_registry_entity.mdm_worker_class_name
10
10
  return const_get worker_class_name if const_defined? worker_class_name
@@ -27,7 +27,7 @@ module GlobalRegistry #:nodoc:
27
27
  pull_mdm_id_from_global_registry
28
28
  rescue ActiveRecord::RecordNotFound
29
29
  # If the record was deleted after the job was created, swallow it
30
- return
30
+ nil
31
31
  rescue RestClient::ResourceNotFound
32
32
  Rails.logger.info "GR entity for #{self.class.name} #{id} does not exist; will _not_ retry"
33
33
  end
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'global_registry_bindings/worker'
4
- require 'global_registry_bindings/entity/entity_type_methods'
5
- require 'global_registry_bindings/entity/push_entity_methods'
3
+ require "global_registry_bindings/worker"
4
+ require "global_registry_bindings/entity/entity_type_methods"
5
+ require "global_registry_bindings/entity/push_entity_methods"
6
6
 
7
- module GlobalRegistry #:nodoc:
8
- module Bindings #:nodoc:
9
- module Workers #:nodoc:
7
+ module GlobalRegistry # :nodoc:
8
+ module Bindings # :nodoc:
9
+ module Workers # :nodoc:
10
10
  class PushEntityWorker < GlobalRegistry::Bindings::Worker
11
11
  include GlobalRegistry::Bindings::Entity::EntityTypeMethods
12
12
  include GlobalRegistry::Bindings::Entity::PushEntityMethods
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'global_registry_bindings/worker'
4
- require 'global_registry_bindings/entity/relationship_type_methods'
5
- require 'global_registry_bindings/entity/push_relationship_methods'
3
+ require "global_registry_bindings/worker"
4
+ require "global_registry_bindings/entity/relationship_type_methods"
5
+ require "global_registry_bindings/entity/push_relationship_methods"
6
6
 
7
- module GlobalRegistry #:nodoc:
8
- module Bindings #:nodoc:
9
- module Workers #:nodoc:
7
+ module GlobalRegistry # :nodoc:
8
+ module Bindings # :nodoc:
9
+ module Workers # :nodoc:
10
10
  class PushRelationshipWorker < GlobalRegistry::Bindings::Worker
11
11
  include GlobalRegistry::Bindings::Entity::RelationshipTypeMethods
12
12
  include GlobalRegistry::Bindings::Entity::PushRelationshipMethods
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_support/lazy_load_hooks'
4
- require 'global_registry_bindings/global_registry_bindings'
5
- require 'global_registry_bindings/railtie' if defined? ::Rails::Railtie
3
+ require "active_support/lazy_load_hooks"
4
+ require "global_registry_bindings/global_registry_bindings"
5
+ require "global_registry_bindings/railtie" if defined? ::Rails::Railtie
6
6
 
7
7
  module GlobalRegistry
8
8
  module Bindings