Sha256: 9e8901bf9d79f926c24717398835dfb1df3bf4e8493eac073406917827c9d14a

Contents?: true

Size: 436 Bytes

Versions: 6

Compression:

Stored size: 436 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
  class PublicSubscriptionEvent < ApplicationRecord
    self.table_name = :message_bus_subscription_events

    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

6 entries across 6 versions & 1 rubygems

Version Path
nulogy_message_bus_producer-2.1.1 lib/nulogy_message_bus_producer/public_subscription_event.rb
nulogy_message_bus_producer-2.1.0 lib/nulogy_message_bus_producer/public_subscription_event.rb
nulogy_message_bus_producer-2.0.0 lib/nulogy_message_bus_producer/public_subscription_event.rb
nulogy_message_bus_producer-1.0.4 lib/nulogy_message_bus_producer/public_subscription_event.rb
nulogy_message_bus_producer-1.0.3 lib/nulogy_message_bus_producer/public_subscription_event.rb
nulogy_message_bus_producer-1.0.2 lib/nulogy_message_bus_producer/public_subscription_event.rb