Class: ActiveRecord::ConnectionAdapters::ForeignKeyDefinition
- Inherits:
-
Struct
- Object
- Struct
- ActiveRecord::ConnectionAdapters::ForeignKeyDefinition
- Defined in:
- lib/schema_plus/active_record/connection_adapters/foreign_key_definition.rb
Overview
:nodoc:
Direct Known Subclasses
SchemaPlus::ActiveRecord::ConnectionAdapters::ForeignKeyDefinition
Instance Attribute Summary collapse
-
#from_table ⇒ Object
Returns the value of attribute from_table.
-
#options ⇒ Object
Returns the value of attribute options.
-
#to_table ⇒ Object
Returns the value of attribute to_table.
Instance Method Summary collapse
- #column ⇒ Object
- #custom_primary_key? ⇒ Boolean
-
#name ⇒ Object
The name of the foreign key constraint.
-
#on_delete ⇒ Object
The ON_DELETE behavior for the constraint.
-
#on_update ⇒ Object
The ON_UPDATE behavior for the constraint.
- #primary_key ⇒ Object
Instance Attribute Details
#from_table ⇒ Object
Returns the value of attribute from_table
2 3 4 |
# File 'lib/schema_plus/active_record/connection_adapters/foreign_key_definition.rb', line 2 def from_table @from_table end |
#options ⇒ Object
Returns the value of attribute options
2 3 4 |
# File 'lib/schema_plus/active_record/connection_adapters/foreign_key_definition.rb', line 2 def @options end |
#to_table ⇒ Object
Returns the value of attribute to_table
2 3 4 |
# File 'lib/schema_plus/active_record/connection_adapters/foreign_key_definition.rb', line 2 def to_table @to_table end |
Instance Method Details
#column ⇒ Object
8 9 10 |
# File 'lib/schema_plus/active_record/connection_adapters/foreign_key_definition.rb', line 8 def column [:column] end |
#custom_primary_key? ⇒ Boolean
28 29 30 |
# File 'lib/schema_plus/active_record/connection_adapters/foreign_key_definition.rb', line 28 def custom_primary_key? [:primary_key] != default_primary_key end |
#name ⇒ Object
The name of the foreign key constraint
4 5 6 |
# File 'lib/schema_plus/active_record/connection_adapters/foreign_key_definition.rb', line 4 def name [:name] end |
#on_delete ⇒ Object
The ON_DELETE behavior for the constraint. See above for the possible values.
18 19 20 |
# File 'lib/schema_plus/active_record/connection_adapters/foreign_key_definition.rb', line 18 def on_delete [:on_delete] end |
#on_update ⇒ Object
The ON_UPDATE behavior for the constraint. See above for the possible values.
24 25 26 |
# File 'lib/schema_plus/active_record/connection_adapters/foreign_key_definition.rb', line 24 def on_update [:on_update] end |
#primary_key ⇒ Object
12 13 14 |
# File 'lib/schema_plus/active_record/connection_adapters/foreign_key_definition.rb', line 12 def primary_key [:primary_key] || default_primary_key end |