# activerecord-spanner-adapter - Class ActiveRecordSpannerAdapter::ForeignKey (v2.2.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.2.0 (latest)](https://docs.cloud.google.com/ruby/docs/reference/activerecord-spanner-adapter/latest/ActiveRecordSpannerAdapter-ForeignKey)
- [2.1.0](https://docs.cloud.google.com/ruby/docs/reference/activerecord-spanner-adapter/2.1.0/ActiveRecordSpannerAdapter-ForeignKey)
- [2.0.0](https://docs.cloud.google.com/ruby/docs/reference/activerecord-spanner-adapter/2.0.0/ActiveRecordSpannerAdapter-ForeignKey)
Reference documentation and code samples for the activerecord-spanner-adapter class ActiveRecordSpannerAdapter::ForeignKey.

## Inherits

- Object

## Methods

### #columns

    def columns()

Returns the value of attribute columns.

### #columns=

    def columns=(value)

Sets the attribute columns

### #initialize

    def initialize(table_name, name, columns, ref_table, ref_columns, on_delete: nil, on_update: nil, table_schema: "", ref_schema: "") -> ForeignKey

**Returns**

- ([ForeignKey](https://docs.cloud.google.com/ruby/docs/reference/activerecord-spanner-adapter/latest/ActiveRecordSpannerAdapter-ForeignKey)) --- a new instance of ForeignKey

### #name

    def name()

Returns the value of attribute name.

### #name=

    def name=(value)

Sets the attribute name

### #on_delete

    def on_delete()

Returns the value of attribute on_delete.

### #on_delete=

    def on_delete=(value)

Sets the attribute on_delete

### #on_update

    def on_update()

Returns the value of attribute on_update.

### #on_update=

    def on_update=(value)

Sets the attribute on_update

### #ref_columns

    def ref_columns()

Returns the value of attribute ref_columns.

### #ref_columns=

    def ref_columns=(value)

Sets the attribute ref_columns

### #ref_schema

    def ref_schema()

Returns the value of attribute ref_schema.

### #ref_schema=

    def ref_schema=(value)

Sets the attribute ref_schema

### #ref_table

    def ref_table()

Returns the value of attribute ref_table.

### #ref_table=

    def ref_table=(value)

Sets the attribute ref_table

### #table_name

    def table_name()

Returns the value of attribute table_name.

### #table_name=

    def table_name=(value)

Sets the attribute table_name

### #table_schema

    def table_schema()

Returns the value of attribute table_schema.

### #table_schema=

    def table_schema=(value)

Sets the attribute table_schema