Sha256: 42c9836a5ce6fbfd5d56f032fc3db9cf206dec812c1ce885b9095d8ae0d04d69

Contents?: true

Size: 650 Bytes

Versions: 1

Compression:

Stored size: 650 Bytes

Contents

module NulogyMessageBusProducer
  # A model that contains the event data for a particular subscription
  # It is simply saved in the database and shipped to Kafka by Debezium
  # TODO: rename this --- can be from a subscription or publication
  # Message? -- kinda conflicts with a "kafka message" but that is on the consumer side.
  class SubscriptionEvent < ApplicationRecord
    self.table_name = :message_bus_subscription_events

    # TODO: this should be renamed. You can't update an Event.
    def self.create_or_update(attrs)
      find_or_initialize_by(id: attrs[:id]).tap do |model|
        model.update!(attrs)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nulogy_message_bus_producer-4.0.0.alpha lib/nulogy_message_bus_producer/subscription_event.rb