From 95c4101fbe9800217bcacd107fa058e197e28d97 Mon Sep 17 00:00:00 2001 From: Yasuo Honda Date: Wed, 30 Jan 2019 12:17:58 +0000 Subject: Address `test_belongs_to_does_not_use_order_by` failure due to checking order by for metadata queries Also, `test_has_one_does_not_use_order_by` should not check metadata queries. Fixes #35098 --- activerecord/test/cases/associations/belongs_to_associations_test.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activerecord/test/cases/associations/belongs_to_associations_test.rb') diff --git a/activerecord/test/cases/associations/belongs_to_associations_test.rb b/activerecord/test/cases/associations/belongs_to_associations_test.rb index a61569420e..c01138c059 100644 --- a/activerecord/test/cases/associations/belongs_to_associations_test.rb +++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb @@ -63,7 +63,8 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase ActiveRecord::SQLCounter.clear_log Client.find(3).firm ensure - assert ActiveRecord::SQLCounter.log_all.all? { |sql| /order by/i !~ sql }, "ORDER BY was used in the query" + sql_log = ActiveRecord::SQLCounter.log + assert sql_log.all? { |sql| /order by/i !~ sql }, "ORDER BY was used in the query: #{sql_log}" end def test_belongs_to_with_primary_key -- cgit v1.2.3