Class: Hecks::Adapters::SQLDatabase::Commands::Update::LinkToReferences

Inherits:
Object
  • Object
show all
Defined in:
lib/commands/update/link_to_references.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reference:, table:, reference_ids:, attributes:, id:) ⇒ LinkToReferences

Returns a new instance of LinkToReferences.



8
9
10
11
12
13
14
15
16
# File 'lib/commands/update/link_to_references.rb', line 8

def initialize(reference:, table:, reference_ids:, attributes:, id:)
  @reference = reference
  @reference_ids = reference_ids
  @table = table
  @attributes = attributes
  @column = Column.factory(@reference)
  @record = {}
  @id = id
end

Instance Attribute Details

#reference_idsObject (readonly)

Returns the value of attribute reference_ids.



7
8
9
# File 'lib/commands/update/link_to_references.rb', line 7

def reference_ids
  @reference_ids
end

Instance Method Details

#callObject



18
19
20
21
22
# File 'lib/commands/update/link_to_references.rb', line 18

def call
  make_linking_records
  make_foreign_keys
  self
end