Sha256: 24bf10c56ab8409bc23c24b0aca84fa82fe943b570054ba46de2b8e93de5cbb1

Contents?: true

Size: 580 Bytes

Versions: 5

Compression:

Stored size: 580 Bytes

Contents

# frozen_string_literal: true

module CycloneLariat
  class Outbox
    module Loadable
      def load
        extend_driver_transaction
      end

      private

      def extend_driver_transaction
        case CycloneLariat.config.driver
        when :sequel
          Sequel::Database.prepend(Outbox::Extensions::SequelOutbox)
        when :active_record
          ActiveRecord::ConnectionAdapters::AbstractAdapter.prepend(Outbox::Extensions::ActiveRecordOutbox)
        else
          raise ArgumentError, "Undefined driver `#{driver}`"
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cyclone_lariat-1.0.0 lib/cyclone_lariat/plugins/outbox/loadable.rb
cyclone_lariat-1.0.0.rc9 lib/cyclone_lariat/plugins/outbox/loadable.rb
cyclone_lariat-1.0.0.rc8 lib/cyclone_lariat/plugins/outbox/loadable.rb
cyclone_lariat-1.0.0.rc7 lib/cyclone_lariat/plugins/outbox/loadable.rb
cyclone_lariat-1.0.0.rc6 lib/cyclone_lariat/plugins/outbox/loadable.rb