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 add_reference options validated on < 7.1 #50680

Merged
merged 1 commit into from
Jan 15, 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 add_reference method was missing in the compatibility layer which results in pre 7.1 Migrations validating options passed to add_reference.

Detail

This commit fixes the issue by adding add_reference to the compatibility layer. In addition to adding add_reference to the "no validation" compatibility test, the test is refactored to run against each previous migration version to ensure that they all behave consistently.

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.

@skipkayhil skipkayhil added this to the 7.1.3 milestone Jan 9, 2024
@skipkayhil skipkayhil force-pushed the hm-fix-legacy-add-reference branch 2 times, most recently from 5dd74dd to d5ab550 Compare January 9, 2024 20:18
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 add_reference
method was missing in the compatibility layer which results in pre 7.1
Migrations validating options passed to add_reference.

This commit fixes the issue by adding add_reference to the compatibility
layer. In addition to adding add_reference to the "no validation"
compatibility test, the test is refactored to run against each previous
migration version to ensure that they all behave consistently.

[1]: e6da3eb
@rafaelfranca rafaelfranca merged commit 62972a1 into rails:main Jan 15, 2024
4 checks passed
rafaelfranca added a commit that referenced this pull request Jan 15, 2024
Fix add_reference options validated on < 7.1
@skipkayhil skipkayhil deleted the hm-fix-legacy-add-reference branch January 19, 2024 02:03
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