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

Fix t.references validating options on Rails < 7.1 #50773

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

skipkayhil
Copy link
Member

Motivation / Background

Option validation was added for 7.1+ Migration classes, and a compatibility layer was added to ensure that previous Migration versions do not have their options validated. However, the t.references method was missing in the compatibility layer which results in pre 7.1 Migrations validating options passed to t.references.

Detail

This commit fixes the issue by adding t.references to the compatibility layer.

See also a similar fix for add_reference

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

Option validation was [added][1] for 7.1+ Migration classes, and a
compatibility layer was added to ensure that previous Migration versions
do not have their options validated. However, the `t.references` method
was missing in the compatibility layer which results in pre 7.1
Migrations validating options passed to `t.references`.

This commit fixes the issue by adding t.references to the compatibility
layer.

See also a [similar fix][2] for `add_reference`

[1]: e6da3eb
[2]: 71b4e22
@skipkayhil skipkayhil added this to the 7.1.3 milestone Jan 16, 2024
@rafaelfranca rafaelfranca modified the milestones: 7.1.3, 7.1.4 Jan 16, 2024
@rafaelfranca rafaelfranca merged commit 474ee0a into rails:main Jan 16, 2024
4 checks passed
rafaelfranca added a commit that referenced this pull request Jan 16, 2024
Fix t.references validating options on Rails < 7.1
@skipkayhil skipkayhil deleted the hm-fix-another-compat-issue branch January 16, 2024 23:11
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

2 participants