Sha256: 896ce5a906dc95f6b3f0e33f49ebb650304b0c94a56acd92635fcf43e5ccd3b6

Contents?: true

Size: 522 Bytes

Versions: 18

Compression:

Stored size: 522 Bytes

Contents

module Helpers
  def qualified_attribute(*args)
    ROM::SQL::QualifiedAttribute[*args]
  end

  def assoc_name(*args)
    ROM::SQL::Association::Name[*args]
  end

  def define_schema(name, attrs)
    ROM::SQL::Schema.define(
      name,
      attributes: attrs.map { |key, value| value.meta(name: key, source: ROM::Relation::Name.new(name)) },
      attr_class: ROM::SQL::Attribute
    )
  end

  def define_type(name, id, **opts)
    ROM::SQL::Attribute.new(ROM::Types.const_get(id).meta(name: name, **opts))
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rom-sql-1.3.5 spec/support/helpers.rb
rom-sql-1.3.4 spec/support/helpers.rb
rom-sql-1.3.3 spec/support/helpers.rb
rom-sql-1.3.2 spec/support/helpers.rb
rom-sql-1.3.1 spec/support/helpers.rb
rom-sql-1.3.0 spec/support/helpers.rb
rom-sql-1.2.2 spec/support/helpers.rb
rom-sql-1.2.1 spec/support/helpers.rb
rom-sql-1.2.0 spec/support/helpers.rb
rom-sql-1.1.2 spec/support/helpers.rb
rom-sql-1.1.1 spec/support/helpers.rb
rom-sql-1.1.0 spec/support/helpers.rb
rom-sql-1.0.3 spec/support/helpers.rb
rom-sql-1.0.2 spec/support/helpers.rb
rom-sql-1.0.1 spec/support/helpers.rb
rom-sql-1.0.0 spec/support/helpers.rb
rom-sql-1.0.0.rc2 spec/support/helpers.rb
rom-sql-1.0.0.rc1 spec/support/helpers.rb