module ActionPubsub::ActiveRecord::Events::Destroyed

Public Instance Methods

publish_destroyed_event() click to toggle source
# File lib/action_pubsub/active_record/events/destroyed.rb, line 14
def publish_destroyed_event
  routing_key = [self.class.exchange_prefix, "destroyed"].join("/")

  record_destroyed_event = ::ActionPubsub::Event.new(
    :topic => routing_key,
    :record => self
  )

  ::ActiveRecord::Base.connection_pool.with_connection do
    ::ActionPubsub.publish_event(routing_key, record_destroyed_event)
  end
end