Class: ROM::SQL::Schema::DSL Private
- Inherits:
-
ROM::Schema::DSL
- Object
- ROM::Schema::DSL
- ROM::SQL::Schema::DSL
- Defined in:
- lib/rom/sql/schema/dsl.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Extended schema DSL
Instance Attribute Summary collapse
- #associations_dsl ⇒ Object readonly private
Instance Method Summary collapse
-
#associations(&block) ⇒ AssociationDSL
Define associations for a relation.
-
#call ⇒ Object
private
Return a schema.
Instance Attribute Details
#associations_dsl ⇒ Object (readonly)
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.
12 13 14 |
# File 'lib/rom/sql/schema/dsl.rb', line 12 def associations_dsl @associations_dsl end |
Instance Method Details
#associations(&block) ⇒ AssociationDSL
Define associations for a relation
43 44 45 |
# File 'lib/rom/sql/schema/dsl.rb', line 43 def associations(&block) @associations_dsl = AssociationsDSL.new(relation, &block) end |
#call ⇒ 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.
Return a schema
50 51 52 53 54 |
# File 'lib/rom/sql/schema/dsl.rb', line 50 def call SQL::Schema.define( relation, opts.merge(attributes: attributes.values, attr_class: SQL::Attribute) ) end |