Class: ROM::SQL::Migration::SchemaDiff::ForeignKeyDiff Private

Inherits:
Object
  • Object
show all
Defined in:
lib/rom/sql/migration/schema_diff.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Direct Known Subclasses

ForeignKeyAdded, ForeignKeyRemoved

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(foreign_key) ⇒ ForeignKeyDiff

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.

Returns a new instance of ForeignKeyDiff.



155
156
157
# File 'lib/rom/sql/migration/schema_diff.rb', line 155

def initialize(foreign_key)
  @foreign_key = foreign_key
end

Instance Attribute Details

#foreign_keyObject (readonly)

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.



153
154
155
# File 'lib/rom/sql/migration/schema_diff.rb', line 153

def foreign_key
  @foreign_key
end

Instance Method Details

#child_keysObject

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.



167
168
169
# File 'lib/rom/sql/migration/schema_diff.rb', line 167

def child_keys
  foreign_key.attributes.map(&:name)
end

#parentObject

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.



159
160
161
# File 'lib/rom/sql/migration/schema_diff.rb', line 159

def parent
  foreign_key.parent_table
end

#parent_keysObject

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.



163
164
165
# File 'lib/rom/sql/migration/schema_diff.rb', line 163

def parent_keys
  foreign_key.parent_keys
end