Class: ROM::SQL::Wrap
- Inherits:
-
Relation::Wrap
- Object
- Relation::Wrap
- ROM::SQL::Wrap
- Defined in:
- lib/rom/sql/wrap.rb
Overview
Specialized wrap relation for SQL
This type of relations is returned when using ‘Relation#wrap` and it uses a join, unlike `Relation#combine` which makes separate queries. This means a relation is restricted only to tuples which have associated tuples, so it should be used in cases where you want to rely on this restriction.
Instance Method Summary collapse
-
#relation ⇒ Relation
private
Internal method used by abstract ‘ROM::Relation::Wrap`.
-
#schema ⇒ Schema
Return a schema which includes attributes from wrapped relations.
Instance Method Details
#relation ⇒ Relation
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 method used by abstract ‘ROM::Relation::Wrap`
31 32 33 34 35 36 |
# File 'lib/rom/sql/wrap.rb', line 31 def relation relation = nodes.reduce(root) do |a, e| a.associations[e.name.key].join(:join, a, e) end schema.(relation) end |