Class: ActiveRecordSpannerAdapter::ForeignKey

Inherits:
Object
  • Object
show all
Defined in:
lib/activerecord_spanner_adapter/foreign_key.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table_name, name, columns, ref_table, ref_columns, on_delete: nil, on_update: nil, table_schema: "", ref_schema: "") ⇒ ForeignKey

Returns a new instance of ForeignKey.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/activerecord_spanner_adapter/foreign_key.rb', line 12

def initialize \
    table_name,
    name,
    columns,
    ref_table,
    ref_columns,
    on_delete: nil,
    on_update: nil,
    table_schema: "",
    ref_schema: ""
  @table_schema = table_schema
  @table_name = table_name
  @name = name
  @columns = Array(columns)
  @ref_schema = ref_schema
  @ref_table = ref_table
  @ref_columns = Array(ref_columns)
  @on_delete = on_delete unless on_delete == "NO ACTION"
  @on_update = on_update unless on_update == "NO ACTION"
end

Instance Attribute Details

#columnsObject

Returns the value of attribute columns.



9
10
11
# File 'lib/activerecord_spanner_adapter/foreign_key.rb', line 9

def columns
  @columns
end

#nameObject

Returns the value of attribute name.



9
10
11
# File 'lib/activerecord_spanner_adapter/foreign_key.rb', line 9

def name
  @name
end

#on_deleteObject

Returns the value of attribute on_delete.



9
10
11
# File 'lib/activerecord_spanner_adapter/foreign_key.rb', line 9

def on_delete
  @on_delete
end

#on_updateObject

Returns the value of attribute on_update.



9
10
11
# File 'lib/activerecord_spanner_adapter/foreign_key.rb', line 9

def on_update
  @on_update
end

#ref_columnsObject

Returns the value of attribute ref_columns.



9
10
11
# File 'lib/activerecord_spanner_adapter/foreign_key.rb', line 9

def ref_columns
  @ref_columns
end

#ref_schemaObject

Returns the value of attribute ref_schema.



9
10
11
# File 'lib/activerecord_spanner_adapter/foreign_key.rb', line 9

def ref_schema
  @ref_schema
end

#ref_tableObject

Returns the value of attribute ref_table.



9
10
11
# File 'lib/activerecord_spanner_adapter/foreign_key.rb', line 9

def ref_table
  @ref_table
end

#table_nameObject

Returns the value of attribute table_name.



9
10
11
# File 'lib/activerecord_spanner_adapter/foreign_key.rb', line 9

def table_name
  @table_name
end

#table_schemaObject

Returns the value of attribute table_schema.



9
10
11
# File 'lib/activerecord_spanner_adapter/foreign_key.rb', line 9

def table_schema
  @table_schema
end