Sha256: e3fa3b94c8bd0fc3fc8667643b04b5f4b9465cdd6755ca31d538a891494ea50e

Contents?: true

Size: 756 Bytes

Versions: 26

Compression:

Stored size: 756 Bytes

Contents

require_relative "success_serializer"

module Foobara
  module CommandConnectors
    module Serializers
      class RecordStoreSerializer < SuccessSerializer
        def atomic_serializer
          @atomic_serializer ||= AtomicSerializer.new(declaration_data)
        end

        def serialize(_object)
          store = {}

          declaration_data.command.transactions.each do |tx|
            tx.each_table do |table|
              key = table.entity_class.full_entity_name

              map = store[key] ||= {}

              table.tracked_records.each do |record|
                map[record.primary_key] = atomic_serializer.transform(record)
              end
            end
          end

          store
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
foobara-0.0.26 projects/command_connectors/src/serializers/record_store_serializer.rb
foobara-0.0.25 projects/command_connectors/src/serializers/record_store_serializer.rb
foobara-0.0.24 projects/command_connectors/src/serializers/record_store_serializer.rb
foobara-0.0.23 projects/command_connectors/src/serializers/record_store_serializer.rb
foobara-0.0.22 projects/command_connectors/src/serializers/record_store_serializer.rb
foobara-0.0.21 projects/command_connectors/src/serializers/record_store_serializer.rb
foobara-0.0.20 projects/command_connectors/src/serializers/record_store_serializer.rb
foobara-0.0.19 projects/command_connectors/src/serializers/record_store_serializer.rb
foobara-0.0.18 projects/command_connectors/src/serializers/record_store_serializer.rb
foobara-0.0.17 projects/command_connectors/src/serializers/record_store_serializer.rb
foobara-0.0.16 projects/command_connectors/src/serializers/record_store_serializer.rb
foobara-0.0.15 projects/command_connectors/src/serializers/record_store_serializer.rb
foobara-0.0.14 projects/command_connectors/src/serializers/record_store_serializer.rb
foobara-0.0.13 projects/command_connectors/src/serializers/record_store_serializer.rb
foobara-0.0.12 projects/command_connectors/src/serializers/record_store_serializer.rb
foobara-0.0.11 projects/command_connectors/src/serializers/record_store_serializer.rb
foobara-0.0.10 projects/command_connectors/src/serializers/record_store_serializer.rb
foobara-0.0.9 projects/command_connectors/src/serializers/record_store_serializer.rb
foobara-0.0.8 projects/command_connectors/src/serializers/record_store_serializer.rb
foobara-0.0.7 projects/command_connectors/src/serializers/record_store_serializer.rb