Flowdock
method

foreign_key_exists?

Importance_1
Ruby on Rails latest stable (v5.2.3) - 0 notes - Class: ActiveRecord::ConnectionAdapters::Table
foreign_key_exists?(*args) public

Checks to see if a foreign key exists.

t.foreign_key(:authors) unless t.foreign_key_exists?(:authors)

See {connection.foreign_key_exists?}[rdoc-ref:SchemaStatements#foreign_key_exists?]

Show source
Register or log in to add new notes.