Class: ActiveRecord::ConnectionAdapters::ForeignKeyDefinition

Inherits:
Struct
  • Object
show all
Defined in:
lib/schema_plus/active_record/connection_adapters/foreign_key_definition.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#from_tableObject

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

#optionsObject

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
  @options
end

#to_tableObject

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

#columnObject


8
9
10
# File 'lib/schema_plus/active_record/connection_adapters/foreign_key_definition.rb', line 8

def column
  options[: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?
  options[:primary_key] != default_primary_key
end

#nameObject

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
  options[:name]
end

#on_deleteObject

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
  options[:on_delete]
end

#on_updateObject

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
  options[:on_update]
end

#primary_keyObject


12
13
14
# File 'lib/schema_plus/active_record/connection_adapters/foreign_key_definition.rb', line 12

def primary_key
  options[:primary_key] || default_primary_key
end