Class: ROM::SQL::Schema
- Inherits:
-
ROM::Schema
- Object
- ROM::Schema
- ROM::SQL::Schema
- Defined in:
- lib/rom/sql/schema.rb,
lib/rom/sql/schema/dsl.rb,
lib/rom/sql/schema/inferrer.rb,
lib/rom/sql/schema/associations_dsl.rb,
lib/rom/sql/extensions/postgres/inferrer.rb
Defined Under Namespace
Classes: AssociationsDSL, DSL, Inferrer, PostgresInferrer
Instance Attribute Summary collapse
-
#primary_key_name ⇒ Object
readonly
Returns the value of attribute primary_key_name.
-
#primary_key_names ⇒ Object
readonly
Returns the value of attribute primary_key_names.
Instance Method Summary collapse
- #finalize! ⇒ Object private
-
#initialize ⇒ Schema
constructor
A new instance of Schema.
Constructor Details
#initialize ⇒ Schema
Returns a new instance of Schema.
16 17 18 19 20 |
# File 'lib/rom/sql/schema.rb', line 16 def initialize(*) super @primary_key_name = nil @primary_key_names = EMPTY_ARRAY end |
Instance Attribute Details
#primary_key_name ⇒ Object (readonly)
Returns the value of attribute primary_key_name.
10 11 12 |
# File 'lib/rom/sql/schema.rb', line 10 def primary_key_name @primary_key_name end |
#primary_key_names ⇒ Object (readonly)
Returns the value of attribute primary_key_names.
14 15 16 |
# File 'lib/rom/sql/schema.rb', line 14 def primary_key_names @primary_key_names end |
Instance Method Details
#finalize! ⇒ 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.
23 24 25 26 27 28 29 30 |
# File 'lib/rom/sql/schema.rb', line 23 def finalize!(*) super do if primary_key.size > 0 @primary_key_name = primary_key[0].[:name] @primary_key_names = primary_key.map { |type| type.[:name] } end end end |