Merge pull request #44168 from aidanharan/relation-test-order

ActiveRecord::RelationTest: Sort results before asserting equality
This commit is contained in:
Ryuta Kamizono 2022-01-21 09:33:40 +09:00 committed by GitHub
commit 1e44daeed8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -293,7 +293,7 @@ module ActiveRecord
skip_if_sqlite3_version_includes_quoting_bug
quoted_join = ActiveRecord::Base.connection.quote_table_name("join")
selected = Post.select(:join).from(Post.select("id as #{quoted_join}")).map(&:join)
assert_equal Post.pluck(:id), selected
assert_equal Post.pluck(:id).sort, selected.sort
end
def test_selecting_aliased_attribute_quotes_column_name_when_from_is_used