Class: GlobalRegistry::Bindings::Workers::PushRelationshipWorker
- Inherits:
-
GlobalRegistry::Bindings::Worker
- Object
- GlobalRegistry::Bindings::Worker
- GlobalRegistry::Bindings::Workers::PushRelationshipWorker
- Defined in:
- lib/global_registry_bindings/workers/push_relationship_worker.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from GlobalRegistry::Bindings::Worker
Instance Method Summary collapse
-
#initialize(model = nil, type = nil) ⇒ PushRelationshipWorker
constructor
A new instance of PushRelationshipWorker.
- #perform(model_class, id, type) ⇒ Object
Methods included from Entity::PushRelationshipMethods
#create_relationship_in_global_registry, #delete_relationship_from_global_registry, #ensure_related_entities_have_global_registry_ids!, #global_registry_relationship_entity_id_from_entity, #push_primary_to_global_registry, #push_related_to_global_registry, #push_relationship_to_global_registry, #put_relationship_to_global_registry, #relationship, #relationship_entity, #valid_update?
Methods included from Entity::RelationshipTypeMethods
#primary_associated_entity_type_id, #push_global_registry_relationship_type, #push_global_registry_relationship_type_fields, #related_associated_entity_type_id, #relationship_type_cache_key, #rename_relationship_entity_type
Methods inherited from GlobalRegistry::Bindings::Worker
perform_async, perform_async_real
Constructor Details
#initialize(model = nil, type = nil) ⇒ PushRelationshipWorker
Returns a new instance of PushRelationshipWorker.
17 18 19 20 |
# File 'lib/global_registry_bindings/workers/push_relationship_worker.rb', line 17 def initialize(model = nil, type = nil) super model self.type = type.to_sym if type end |
Instance Attribute Details
#type ⇒ Object
Returns the value of attribute type.
15 16 17 |
# File 'lib/global_registry_bindings/workers/push_relationship_worker.rb', line 15 def type @type end |
Instance Method Details
#perform(model_class, id, type) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/global_registry_bindings/workers/push_relationship_worker.rb', line 22 def perform(model_class, id, type) super model_class, id self.type = type.to_sym push_relationship_to_global_registry rescue ActiveRecord::RecordNotFound # rubocop:disable Lint/HandleExceptions # If the record was deleted after the job was created, swallow it end |