diff options
author | Gannon McGibbon <gannon.mcgibbon@gmail.com> | 2019-02-02 16:08:55 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-02 16:08:55 -0500 |
commit | 00f7dbab7590c6ffd188da186067eb269e11580f (patch) | |
tree | 45f463e07ed923f5a6b70858c79926f976336d1e | |
parent | 921d1d2d507480f41218e69555d678d41e465524 (diff) | |
parent | 13f8beb435139bd96e27640e6d198b3ebf9cdecc (diff) | |
download | rails-00f7dbab7590c6ffd188da186067eb269e11580f.tar.gz rails-00f7dbab7590c6ffd188da186067eb269e11580f.tar.bz2 rails-00f7dbab7590c6ffd188da186067eb269e11580f.zip |
Merge pull request #35105 from olivierlacan/document-table-foreign-key
Hint at advanced options for foreign_key
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb index 16344b160d..b2a6109548 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb @@ -682,9 +682,10 @@ module ActiveRecord end alias :remove_belongs_to :remove_references - # Adds a foreign key. + # Adds a foreign key to the table using a supplied table name. # # t.foreign_key(:authors) + # t.foreign_key(:authors, column: :author_id, primary_key: "id") # # See {connection.add_foreign_key}[rdoc-ref:SchemaStatements#add_foreign_key] def foreign_key(*args) |