Class: ROM::Memory::Schema
- Defined in:
- core/lib/rom/memory/schema.rb
Overview
Specialized schema for memory adapter
Instance Attribute Summary collapse
- #__memoized__ ⇒ Object included from ROM::Memoizable readonly private
Instance Method Summary collapse
- #call(relation) ⇒ Object
-
#finalize_associations!(relations:) ⇒ Object
private
Internal hook used during setup process.
Constructor Details
This class inherits a constructor from ROM::Schema
Instance Attribute Details
#__memoized__ ⇒ Object (readonly) Originally defined in module ROM::Memoizable
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Instance Method Details
#call(relation) ⇒ Object
14 15 16 |
# File 'core/lib/rom/memory/schema.rb', line 14 def call(relation) relation.new(relation.dataset.project(*map(&:name)), schema: self) end |
#finalize_associations!(relations:) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Internal hook used during setup process
23 24 25 26 27 28 29 |
# File 'core/lib/rom/memory/schema.rb', line 23 def finalize_associations!(relations:) super do associations.map do |definition| Memory::Associations.const_get(definition.type).new(definition, relations) end end end |