Repository navigation
Conversation
In rails/rails#58494, Rails 8.2 changed the #columns method to accept both a single table name (same as <= v8.1) and an array of table names (new). When an array, the returned value changes from `[columns]` to `{table_name => [columns]}`. This detects the two variants and sorts each appropriately. Additionally, the automatic alphabetization of columns introduced in v8.1 has been removed again in v8.2 (rails/rails#56565). This updates the test conditional to be strictly 8.1 instead of >= 8.1.
Owner
|
Hi @zarqman, thanks for the PR. Merged a version of this in the commit above. |
Owner
|
Also, fixed the timestamp test in eb88bcf. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In rails/rails#58494, Rails 8.2 changed the #columns method to accept both a single table name (same as <= v8.1) and an array of table names (new). When an array, the returned value changes from
[columns]to{table_name => [columns]}. This detects the two variants and sorts each appropriately.Original error:
Additionally, the automatic alphabetization of columns introduced in v8.1 has been removed again in v8.2 (rails/rails#56565). This updates the test conditional to be strictly 8.1 instead of >= 8.1.
Note: When testing against rails main:HEAD today, I'm seeing a flaky test. I think this is unrelated to the changes in this PR and probably something else in Rails 8.2. It passes sometimes, so might be dependent on test run ordering.