module ROM::Files::Types
Constants
- FileStat
- FileType
- MimeType
- Path
Public Class Methods
ForeignKey(relation, type = Types::Pathname, map: ->(pathname) { pathname }
click to toggle source
Define a foreign key attribute type
@example with default type
attribute :spec_file, Types.ForeignKey(:spec_files)
@example with a custom path map
attribute :spec_file, Types.ForeignKey(:spec_files, key: ->(path) { path.pathmap('spec/%X_spec.rb') })
@return [Dry::Types::Definition]
@api public
Calls superclass method
# File lib/rom/files/types.rb, line 32 def self.ForeignKey(relation, type = Types::Pathname, map: ->(pathname) { pathname }) super(relation, type.meta(__proc__: map)) end