diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-02-08 10:39:14 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-08 10:39:14 +0900 |
commit | 17dd5cc367fc985b8562040d75151b85fde87f06 (patch) | |
tree | d95b8ef94924ca8651b68be7ad7ef8c1a206ac86 | |
parent | b2d8036df7427dca67d1cbe1e3c3e0fd7b33bf56 (diff) | |
parent | 95c4101fbe9800217bcacd107fa058e197e28d97 (diff) | |
download | rails-17dd5cc367fc985b8562040d75151b85fde87f06.tar.gz rails-17dd5cc367fc985b8562040d75151b85fde87f06.tar.bz2 rails-17dd5cc367fc985b8562040d75151b85fde87f06.zip |
Merge pull request #35099 from yahonda/diag35098
Address test_belongs_to_does_not_use_order_by failure
-rw-r--r-- | activerecord/test/cases/associations/belongs_to_associations_test.rb | 3 | ||||
-rw-r--r-- | activerecord/test/cases/associations/has_one_associations_test.rb | 4 |
2 files changed, 4 insertions, 3 deletions
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 diff --git a/activerecord/test/cases/associations/has_one_associations_test.rb b/activerecord/test/cases/associations/has_one_associations_test.rb index 3e5b5c1275..7bb629466d 100644 --- a/activerecord/test/cases/associations/has_one_associations_test.rb +++ b/activerecord/test/cases/associations/has_one_associations_test.rb @@ -37,8 +37,8 @@ class HasOneAssociationsTest < ActiveRecord::TestCase ActiveRecord::SQLCounter.clear_log companies(:first_firm).account ensure - log_all = ActiveRecord::SQLCounter.log_all - assert log_all.all? { |sql| /order by/i !~ sql }, "ORDER BY was used in the query: #{log_all}" + 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_has_one_cache_nils |