1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Sort the results as order not guaranteed

This commit is contained in:
Aidan Haran 2022-01-13 16:31:36 +00:00
parent 83a4fa414b
commit 974d0dd590

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