Class: ROM::SQL::Schema::DSL
- Inherits:
-
ROM::Schema::DSL
- Object
- ROM::Schema::DSL
- ROM::SQL::Schema::DSL
- Defined in:
- lib/rom/sql/schema/dsl.rb
Instance Attribute Summary collapse
-
#associations_dsl ⇒ Object
readonly
Returns the value of attribute associations_dsl.
Instance Method Summary collapse
Instance Attribute Details
#associations_dsl ⇒ Object (readonly)
Returns the value of attribute associations_dsl.
8 9 10 |
# File 'lib/rom/sql/schema/dsl.rb', line 8 def associations_dsl @associations_dsl end |
Instance Method Details
#associations(&block) ⇒ Object
10 11 12 |
# File 'lib/rom/sql/schema/dsl.rb', line 10 def associations(&block) @associations_dsl = AssociationsDSL.new(name, &block) end |
#call ⇒ Object
14 15 16 |
# File 'lib/rom/sql/schema/dsl.rb', line 14 def call SQL::Schema.new(name, attributes, opts) end |
#opts ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/rom/sql/schema/dsl.rb', line 18 def opts opts = { inferrer: inferrer } if associations_dsl { **opts, associations: associations_dsl.call } else opts end end |