Sha256: eec242836761a363dcbe49de7d87f7f093db5c75f9502208cee35b420262de21

Contents?: true

Size: 620 Bytes

Versions: 10

Compression:

Stored size: 620 Bytes

Contents

# frozen_string_literal: true

require 'global_registry_bindings/workers/delete_entity_worker'

module GlobalRegistry #:nodoc:
  module Bindings #:nodoc:
    module Model #:nodoc:
      module DeleteEntity
        extend ActiveSupport::Concern

        included do
          after_commit :delete_entity_from_global_registry_async, on: :destroy
        end

        def delete_entity_from_global_registry_async
          return unless global_registry_entity.id_value?
          ::GlobalRegistry::Bindings::Workers::DeleteEntityWorker.perform_async(global_registry_entity.id_value)
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
global-registry-bindings-0.1.9 lib/global_registry_bindings/model/delete_entity.rb
global-registry-bindings-0.1.8 lib/global_registry_bindings/model/delete_entity.rb
global-registry-bindings-0.1.7 lib/global_registry_bindings/model/delete_entity.rb
global-registry-bindings-0.1.6 lib/global_registry_bindings/model/delete_entity.rb
global-registry-bindings-0.1.5 lib/global_registry_bindings/model/delete_entity.rb
global-registry-bindings-0.1.4 lib/global_registry_bindings/model/delete_entity.rb
global-registry-bindings-0.1.3 lib/global_registry_bindings/model/delete_entity.rb
global-registry-bindings-0.1.2 lib/global_registry_bindings/model/delete_entity.rb
global-registry-bindings-0.1.1 lib/global_registry_bindings/model/delete_entity.rb
global-registry-bindings-0.1.0 lib/global_registry_bindings/model/delete_entity.rb