Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hint at advanced options for foreign_key #35105

Merged
merged 1 commit into from Feb 2, 2019

Conversation

olivierlacan
Copy link
Contributor

We sometimes display simple examples of additional parameters that can be
supplied to table-wise methods like these and I found it particularly difficult
to figure out which options t.foreign_key accepts without drilling very deep
into the specific SchemaStatements docs.

Since it's relatively common to create foreign keys with custom column names or
primary keys, it seems like this should help quite a few people.

I don't love the new description:

Adds a foreign key from the receiver to the supplied table name.

But I think it's a bit less ambiguous about what the first parameter is supposed to point to (since the first parameter to add_foreign_key is implied as t (the receiver) here.

We sometimes display simple examples of additional parameters that can be
supplied to table-wise methods like these and I found it particularly difficult
to figure out which options `t.foreign_key` accepts without drilling very deep
into the specific SchemaStatements docs.

Since it's relatively common to create foreign keys with custom column names or
primary keys, it seems like this should help quite a few people.

[ci skip]
@gmcgibbon gmcgibbon merged commit 00f7dba into rails:master Feb 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants