Sha256: 9b74ecd68a256ba4f9c7b2af14a5160a78eddf03d4e350aeba23a1075c7821bc

Contents?: true

Size: 498 Bytes

Versions: 2

Compression:

Stored size: 498 Bytes

Contents

require 'rom/sql/schema/index_dsl'

module ROM
  module SQL
    class Schema < ROM::Schema
      # @api public
      class DSL < ROM::Schema::DSL
        attr_reader :index_dsl

        def indexes(&block)
          @index_dsl = IndexDSL.new(options, &block)
        end

        def opts
          if index_dsl
            opts = super

            { **opts, indexes: index_dsl.(relation, opts[:attributes]) }
          else
            super
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rom-sql-2.0.0.beta3 lib/rom/sql/schema/dsl.rb
rom-sql-2.0.0.beta2 lib/rom/sql/schema/dsl.rb