Class: ActiveRecord::ConnectionAdapters::ForeignKeyDefinition
- Defined in:
- activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
Overview
:nodoc:
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
- #defined_for?(to_table_ord = nil, to_table: nil, **options) ⇒ Boolean
- #name ⇒ Object
- #on_delete ⇒ Object
- #on_update ⇒ Object
- #primary_key ⇒ Object
Methods inherited from Struct
Instance Attribute Details
#from_table ⇒ Object
Returns the value of attribute from_table
63 64 65 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 63 def from_table @from_table end |
#options ⇒ Object
Returns the value of attribute options
63 64 65 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 63 def @options end |
#to_table ⇒ Object
Returns the value of attribute to_table
63 64 65 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 63 def to_table @to_table end |
Instance Method Details
#column ⇒ Object
68 69 70 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 68 def column [:column] end |
#custom_primary_key? ⇒ Boolean
84 85 86 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 84 def custom_primary_key? [:primary_key] != default_primary_key end |
#defined_for?(to_table_ord = nil, to_table: nil, **options) ⇒ Boolean
88 89 90 91 92 93 94 95 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 88 def defined_for?(to_table_ord = nil, to_table: nil, **) if to_table_ord self.to_table == to_table_ord.to_s else (to_table.nil? || to_table.to_s == self.to_table) && .all? { |k, v| self.[k].to_s == v.to_s } end end |
#name ⇒ Object
64 65 66 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 64 def name [:name] end |
#on_delete ⇒ Object
76 77 78 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 76 def on_delete [:on_delete] end |
#on_update ⇒ Object
80 81 82 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 80 def on_update [:on_update] end |
#primary_key ⇒ Object
72 73 74 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 72 def primary_key [:primary_key] || default_primary_key end |