Module: ROM::SQL::AttributeWrapping Private

Included in:
Attribute, Function
Defined in:
lib/rom/sql/attribute_wrapping.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#wrapped(name = source.dataset) ⇒ Attribute

Return attribute type wrapped for the specified relation name

Parameters:

  • name (Symbol) (defaults to: source.dataset)

    The name of the source relation (defaults to source.dataset)

Returns:


25
26
27
# File 'lib/rom/sql/attribute_wrapping.rb', line 25

def wrapped(name = source.dataset)
  meta(wrapped: name).prefixed(name)
end

#wrapped?Boolean

Return if the attribute type is from a wrapped relation

Wrapped attributes are used when two schemas from different relations are merged together. This way we can identify them easily and handle correctly in places like auto-mapping.

Returns:

  • (Boolean)

14
15
16
# File 'lib/rom/sql/attribute_wrapping.rb', line 14

def wrapped?
  !meta[:wrapped].nil?
end