module ROM::Types::Methods

Type extensions

@api public

Public Instance Methods

ForeignKey(relation, type = Types::Integer) click to toggle source

Shortcut for defining a foreign key attribute type

@param [Symbol] relation The name of the target relation @param [Object] type The type of an attribute

@return [Dry::Types::Nominal]

@api public

# File lib/rom/types.rb, line 33
def ForeignKey(relation, type = Types::Integer)
  type.meta(foreign_key: true, target: relation)
end